Testing Pattern Rules

The Oracle® Enterprise Session Border Controller it yields the results you require. This command is useful for testing the regex values that you devise because it will tell you whether that value is valid or not.

This command is called test-pattern-rule.

To test a pattern rule:

  1. Type test-pattern-rule and press Enter.
    ORACLE# test-pattern-rule
    ORACLE(test-pattern-rule)#
  2. expression—Enter the regular expression that you want to test. If there is a match, then the Oracle® Enterprise Session Border Controller will inform you of it; you will also be informed if there is no match.

    The string against which the Oracle® Enterprise Session Border Controller is matching is not the string parameter that you can use for this command; it is the string value of the regular expression you entered.

    ORACLE(test-pattern-rule)# expression '.*;tgid=(.+).*'
  3. string—Enter the string against which you want to compare the regular expression.
    ORACLE(test-pattern-rule)# string sip:+17024260002@KCMGGWC;user=phone SIP/2.0;tgid=Trunk1
    expression made 3 matches against string
  4. show—Use the show command within test-pattern-rules to view the test pattern that you entered, whether there was a match, and the number of matches.
    ORACLE(test-pattern-rule)# show
    Pattern Rule:
    Expression : .*(;tgid=(.+)).*
    String     : sip:+17024260002@KCMGGWC;user=phone SIP/2.0;tgid=Trunk1
    Matched    : TRUE
    Matches:
    $0 sip:+17024260002@KCMGGWC;user=phone SIP/2.0;tgid=Trunk1
    $1 ;tgid=Trunk1
    $2 Trunk1