TRegularExpression

  • Base type OctetString

A regular expression string. The Regular expression string matches against 1) an AS_PATH string e.g. '100 200 300', 2) a community string e.g. '100:200' where 100 is the as-number, and 200 is the community-value. The regular expression is expressed in terms of a TERM, and an OPERATOR: A term is either: 1) an AS Number 2) a community value e.g. in 100:200, we have three tokens: (i) 100 is the as-number, (ii) ':' is the separator token, and (iii) 200 is the community-value 3) '.' - DOT is a wild-card token which matches with either an AS Number or a Community. The list of operators are: 1) '|' - suggests an alternation. 2) '*' - multiple occurrences of the token. 3) '?' - 0 or 1 occurrence of token. 4) '+' - 1 or more occurrences of token. 5) '(' - is used to parenthesize so that a regular expression is considered as one token. 6) ')' - closes the parenthesis. 7) '[' - used to demarcate range. 8) ']' - closes the box bracket. 9) '{m, [n]}' - suggest that the term can occur anywhere between m, and n times. 10) '^' - matches the beginning of the string - only allowed for communities. 11) '$' - matches the end of the string - only allowed for communities. Note, use only NVT ASCII displayable characters here, no control characters, no UTF-8, etc. The EBNF description for the regular expression string are: 1) reg_ex ::= empty_string | non-empty_reg_ex 2) non-empty_reg_ex ::= bounded_element | ( bounded_element '|' non-empty_reg_ex ) 3) bounded_element ::= ['^'] element ['$'] 4) element ::= ( '(' list ')' | atomic ) ['*' | '?' | '+' | '{' integer ',' [ integer ] '}' ] [element] 5) list ::= element | (element '|' list) 6) atomic ::= '.' | ':' | '<' | '>' | atom_list 7) atom_list ::= atom | ( '[' atom_list_boxed ) 8) atom_list_boxed ::= ( atom ']' ) | ( atom atom_list_boxed ) 9) (for as-path reg-ex) atom ::= integer [ '-' integer ] an atom is essentially EQUIVALENT to a TERM (for community reg-ex) atom ::= digit[ '-' digit ] NOTE -> atom_list_boxed is a list of integers ending in box bracket - BNF description is error-free.