I'm not sure if I'm understanding the documentation incorrectly but I am attempting to capture a specific pattern with regular expressions and it does not seem to work. The documentation regarding the feature I am trying to use is somewhat contradictory and vague. The expression I'm trying to use is as follows:
The documentation says
If I use the above code though it refuses to match multiple instances of the pattern. The description of + says it works on a sub-pattern which later in the documentation is claimed to be a pattern inside parens but then says it can't be used with a Tag. The difference between the two is not clearly made.
The string I'm matching on looks like this:
If there is a better way to do this in PowerBASIC I'm open to that but I'm pretty baffled that I can't utilize REGEXPR to match the subset "IA=5 IA=6 IA=11 " and have it give me the starting position and length so that I can pull it out of the string using parse. Does PowerBASIC really not allow you to match an arbitrary repetition of a sub-pattern or am I somehow adding the quantifier incorrecly?
Code:
mask$ = "(IA=[0-9]+ )+"
+
(plus) Specifies that one or more matches of the preceding sub-pattern are allowed. Cannot be used with a Tag.
(plus) Specifies that one or more matches of the preceding sub-pattern are allowed. Cannot be used with a Tag.
The string I'm matching on looks like this:
Code:
"AZ=1 AZ=5 DE=8 HI=5 HI=9 IA=5 IA=6 IA=11 NY=1 NY=4 WI=3 WI=8 "
Comment