Match group number

Parent Previous Next

Datacol supports regex match group number setting. The example is provided below.




In some cases we may need to get more information about regex match, than just simply matching sequence. E.g. when we use the following regex:

\d+zzz

we may need to get the digit itself. Here you can use match group number. Group - is the numbered area of regex. E.g. the following regex includes 2 groups:


(\d+)zzz


Zero group always addresses the whole match. The first group addresses area, starting with the first opening parenthesis and finishing with closing parenthesis. Thus Datacol can extract not only the whole match (if zero group is selected), but also just the first group match (i.e. needed digits in this example).


Match group usage is demonstrated on example from Selector. The first screenshot demonstrates how we can get the zero match group for the specific regex.



The second screenshot demonstrates how we can get the first match group for the same regex.


Created with the Personal Edition of HelpNDoc: Free iPhone documentation generator