J
JM
Hi,
I am not sure if this is the place to post a REGEX question if not, please
indicate me where i can post it?.
My question:
Given a string like: "Boston. MA. Holidays" I need to define the regular
expression to find each dot, the previous word and the word after. That is i
want to obtain:
first match: "Boston" "." "MA"
second match: "MA" "." "Holidays"
The problem is that if I use somthing like: ([^\s\.]+)(\.)(\s*[^\s\.]+) I
"cosume" MA in the first macth so I do not have a second match. That is I
obtained:
first match: "Boston" "." "MA"
and no more matches, since MA is consumed in the previous match.
Any help??
Thanks,
jaime
I am not sure if this is the place to post a REGEX question if not, please
indicate me where i can post it?.
My question:
Given a string like: "Boston. MA. Holidays" I need to define the regular
expression to find each dot, the previous word and the word after. That is i
want to obtain:
first match: "Boston" "." "MA"
second match: "MA" "." "Holidays"
The problem is that if I use somthing like: ([^\s\.]+)(\.)(\s*[^\s\.]+) I
"cosume" MA in the first macth so I do not have a second match. That is I
obtained:
first match: "Boston" "." "MA"
and no more matches, since MA is consumed in the previous match.
Any help??
Thanks,
jaime