Methods of regular expressions:
| Flags | Start matching | Anchored to | Result if match | No match | re.lastIndex | |
|---|---|---|---|---|---|---|
| exec() | – | 0 | – | Match object | null | unchanged |
| /g | re.lastIndex | – | Match object | null | index after match | |
| /y | re.lastIndex | re.lastIndex | Match object | null | index after match | |
| /gy | re.lastIndex | re.lastIndex | Match object | null | index after match | |
| test() | (Any) | (like exec()) | (like exec()) | true | false | (like exec()) |