if (/.../g) makes no sense conceptually and can lead to really weird behaviour. Get rid of those "g".
Some of your regex patterns contain newlines, yet the string against which you are matching contains at most one at the end.
Your match operators that have /m don't have "^" or "$" in the pattern, making the /m completely useless.
In reply to Re: Specific Regex with Multilines (/s and /m): Why Doesn't This Work?
by ikegami
in thread Specific Regex with Multilines (/s and /m): Why Doesn't This Work?
by elvenwonder
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |