Page 1 of 1

Grouping

Posted: Tue Sep 22, 2009 10:26 am
by misge
Hello,
I have the following structure
R000<text>\n
R515<text>\n
R521<text>\n
R529<text>\n
n times R529's
R529<text>\n
R550<text>\n
R529<text>\n
n times R529's
R529<text>\n

I would like to capture the R000 R515 and the R529's after R521 into group G1 and the R550 and the R529 below R550 in G2.
How is it possible to do it with regex?

Regards,

Re: Grouping

Posted: Thu Sep 24, 2009 8:25 am
by prometheuzz
Your question is not a very good one. For starters, your text does not contain two occurrences of "R550". Also, don't make a description of your input text, but post (a part of) your actual data/text. So remove the '\n' if they're meant as line breaks and remove the "n times R529's" parts and replace them with something from your data. You may also want to post what you have tried yourself: that way people can comment on your regex: you'll learn more that way.

Good luck.