beautypg.com

Precedence of special characters – Visara Master Console Center Scripting Guide User Manual

Page 63

background image

Chapter 4 Regular Expressions

Scripting Guide

63

Precedence of Special Characters

The order of precedence, from high to low, is shown below:

Order Type

Symbols

1 Collation-related

bracket

symbols

[= =] [: :] [. .]

2 Escaped

characters \

character>

3

Bracket expression

[ ]

4 Grouping

(

)

5

Single-character duplication

* + ? {i,j}

6 Concatenation

7 Anchoring

^

$

8 Alternation

|

Table 11. Regular Expression Matching, Order of Precedence

For example, the pattern ‘ab|cd’ is the same as ‘(ab)|(cd)’ but is not
equivalent to ‘a(b|c)d’.