Rather than returning a number, a Regular Expression function can be set to return a structure
The structure will contain 2 keys names pos and len
Each will contain a matching array holding the start position of a match and its length
The first item always contains the entire match and all others contains matches from sub expressions
Use the mid() function to get easy access to the return data