A
argabalala
Hi,
I'm trying to catch all the values matched by subgroups
of the following regex (it's a simplified version, x and y
originally are regex as well).
(??x)|(y)),)*(x)(?:,(?x)|(y)))*|(a)
This expresion means wether :
-I must get an "x" somewhere, and a set (perhaps several) of "x" and
"y"
eventually empty.
-I get a "a"
Sadly, I only catch the last elements that matched the
subgroups. Hence, I loose some "x" and some "y".
Therefore, I use a trick today to do the job :
I globally match the expression using java.util.regex
and then I split the string and match resulting individual
elements to "x", "y" and "a".
So I'm certainly doing the job done twice, because the
first global match must have parsed each "x", "y" and "a"
individually.
Is there a better way to acheive this with java.util.regex ?
Or with any other robust package ?
Thanks for your help,
I'm trying to catch all the values matched by subgroups
of the following regex (it's a simplified version, x and y
originally are regex as well).
(??x)|(y)),)*(x)(?:,(?x)|(y)))*|(a)
This expresion means wether :
-I must get an "x" somewhere, and a set (perhaps several) of "x" and
"y"
eventually empty.
-I get a "a"
Sadly, I only catch the last elements that matched the
subgroups. Hence, I loose some "x" and some "y".
Therefore, I use a trick today to do the job :
I globally match the expression using java.util.regex
and then I split the string and match resulting individual
elements to "x", "y" and "a".
So I'm certainly doing the job done twice, because the
first global match must have parsed each "x", "y" and "a"
individually.
Is there a better way to acheive this with java.util.regex ?
Or with any other robust package ?
Thanks for your help,