G
Guillermo Riojas
Hi,
I have been trying to create a solid regular expression to match a
possible multi-line expression without success. So after several hours i
almost got there but not the point i would like, hoping somebody can
point me in the right direction.
Here is an example i am dealing with:
01xxxxxxxxxxxxxx
|-:
<20>ABCD
<30>edfghi212
-|
|-:
<20>EFGH
<30>hjkli3232
-|
89xxxxxxxxxxxxx
I need to match anything that is enclosed in between "|-:" and "-|"
So far i've got "/^\{\|-:$.*^-\|$/m" , this one is greedy, returning the
complete set, instead of each match, i just haven't figure out how to
make it reluctant enough to return one by one.
The returned matches expected must be something like this:
1:
|-:
<20>ABCD
<30>edfghi212
-|
2:
|-:
<20>EFGH
<30>hjkli3232
-|
Currently is returning:
1:
|-:
<20>ABCD
<30>edfghi212
-|
|-:
<20>EFGH
<30>hjkli3232
-|
Any suggestion is greatly appreciated.
And finally, any good regular expressions book ?? =)
Cheers,
guillermo
I have been trying to create a solid regular expression to match a
possible multi-line expression without success. So after several hours i
almost got there but not the point i would like, hoping somebody can
point me in the right direction.
Here is an example i am dealing with:
01xxxxxxxxxxxxxx
|-:
<20>ABCD
<30>edfghi212
-|
|-:
<20>EFGH
<30>hjkli3232
-|
89xxxxxxxxxxxxx
I need to match anything that is enclosed in between "|-:" and "-|"
So far i've got "/^\{\|-:$.*^-\|$/m" , this one is greedy, returning the
complete set, instead of each match, i just haven't figure out how to
make it reluctant enough to return one by one.
The returned matches expected must be something like this:
1:
|-:
<20>ABCD
<30>edfghi212
-|
2:
|-:
<20>EFGH
<30>hjkli3232
-|
Currently is returning:
1:
|-:
<20>ABCD
<30>edfghi212
-|
|-:
<20>EFGH
<30>hjkli3232
-|
Any suggestion is greatly appreciated.
And finally, any good regular expressions book ?? =)
Cheers,
guillermo