4. The operation priorities of various operators
The operations with the same priority are performed from left to right, and the operations with different priorities are performed from high to low. The precedence of various operators from high to low is as follows:
操作符 | 描述 |
---|---|
转义符 | |
(), (?:), (?=), [] | 圆括号和方括号 |
*, +, ?, {n}, {n,}, {n,m} | 限定符 |
^, $, anymetacharacter | 位置和顺序 |
| | “或”操作 |