Your regexes are correct. (assuming formElement:definition|Alternative definition is the input.)
What is incorrect is that you named your own defined subroutine: split. It is a built-in function.
Your own subroutine will only be called when you call it via &split($something). Else the built-in one will be called.
Here are two suggestions:
a) but a warn/print statement (for debugging purpose) in your function and see if it is called.
b) enable warnings.
In reply to Re: Getting regular expression right
by Animator
in thread Getting regular expression right
by mellin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |