R12 Publication-2025July16

Define Match Pattern

You can configure the control parameters of the current Match Pattern as follows.

  • Rule Name: The rule name is generated automatically, and users can modify it.
  • Compare Paragraph by: Compare each line of two paragraphs and calculate match results based on the selected options.
    • Exact Match: Current string and pattern have identical matched lines.
    • Contain All Pattern: Current string contains all pattern strings and more.
    • Part of Pattern: Current string is part of the pattern string.
  • Compare Each Line by: Decide whether to exact match or not at line level.
  • Ignore Order of lines: Whether to ignore the line order when matching.

Click Learn more about... to see the match pattern rule, and then compare data with patterned text in baseline to know how to use the match pattern.

Please note that you can also directly define the match pattern rule in the pattern file by adding a control line at the end of the pattern line, such as //##{paragraph:contain,line:equal,ignore_order:true}. The settings in pattern file is prior to the UI configurations.

Parameter
Value
paragraph
  • match
  • contain
  • part_of
line
  • equal
  • contain
ignore_order
  • true
  • false

For Example: Edit a golden configuration with a control line in ADT. 

Match Pattern Rule

According to the Match Pattern definition, there are different logic combinations, and there will be different comparison results. The following table lists the sample of compare conditions that are recognized as Matched.

Data Comparison with Patterned Text in Baseline

To compare the device data against a baseline data with some texts that need to be ignored in the comparison, operator Match Pattern will be used while defining the diagnosis.

For the patterned text in ADT, the $var and $mstring are supported. $var can only replace one string by default. If you need to use the patterned text to match multiple strings, you can configure $mstring to match multiple strings. Moreover, the syntax "enum" is also supported for the text rules defined in ADT.

Compare Paragraph byIgnore Order of LinesLeft (Current)Right (Pattern)Results
Compare Each Line by Equal
Exact MatchCheckeda1 a2 a3 a4a1 a2 a3 {$var3}True
a1 a2 {$var3}False
a1 a2 {$var3} {$var4}True
a1 a2 {$mstring:var3}True

Example: Compare configlet data of the device US-BOS-R1 with the golden data (ADT: QOS Golden Data, column Golden Config).

  1. Go to the ADT QOS Golden Data in the Automation Data Table Manager.
  2. In the column Golden Config, edit the text replacing all the numbers next to police using {$var} (such as {$_dummy}).
     
  3. In the intent diagnosis, select the operator Match Pattern and define the match rule to recognize this format. The system will ignore this format according to the definition and determine whether the data matches.