Priority order
After constructing a regular expression, you can evaluate like a mathematical expression, that is, you can evaluate from left to right and in a priority order.
The following table lists the priority order of various regular expression operators from the highest priority to the lowest priority:
Operator | describe |
---|---|
\ | Escape symbol |
(), (?:), (?=), [] | Braces and square brackets |
*, +, ?, {n}, {n,}, {n,m} | Qualifier |
^, $, \anymetacharacter | Position and order |
| | "OR" operation |