UPDATE: I'm making progress, but this is hard!
The test text will be valid[REGEX_EMAIL|REGEX_PASSWORD|REGEX_TEST]
.
(The real life text is required|valid[REGEX_EMAIL]|confirmed[emailconfirmation]|correct[not in|emailconfirmation|email confirmation]
.)
([^|]+)
saves REGEX_EMAIL, REGEX_PASSWORD and REGEX_TEST in an array.
^[^[]+\[
matches valid[
\]
matches ]
^[^[]+\[
+ ([^|]+)
+ \]
doesn't save REGEX_EMAIL, REGEX_PASSWORD and REGEX_TEST in an array.
How to solve?