B
Bill Hertzing
I have a regexpr that consist of a set of alternates, e.g:
(ABC|DEF|XYZ)
I need to know the index (0,1,2) of the alternate that matched. I can't find
anything about this (and I've googled it quite a lot!)
I'm reading a file and creating an indexed collections of objects when my
programs starts. One of the properties of each object is a match pattern. I
create the alternation string from these patterns, ansd instantiate a
RegExpr. The program then gets input from another source, and I pass each
line of input to the RegExpr. If the RegExpr matches, I need to know the
index of the alternation that matched, so I can use that to index back into
the collection and get more information about the object on that line of
input. Then I can further process that line based on what kind of object it
is.
TIA!
(ABC|DEF|XYZ)
I need to know the index (0,1,2) of the alternate that matched. I can't find
anything about this (and I've googled it quite a lot!)
I'm reading a file and creating an indexed collections of objects when my
programs starts. One of the properties of each object is a match pattern. I
create the alternation string from these patterns, ansd instantiate a
RegExpr. The program then gets input from another source, and I pass each
line of input to the RegExpr. If the RegExpr matches, I need to know the
index of the alternation that matched, so I can use that to index back into
the collection and get more information about the object on that line of
input. Then I can further process that line based on what kind of object it
is.
TIA!