in reply to Re: most efficient regex to delete duplicate words
in thread most efficient regex to delete duplicate words
$strint=~s/(\w+)(?:\W\1)+/\1/g;
would be a little faster, as you don't need to store the second parenthesis match thingy, and you don't need to match zero or more copies of the first match, you need to match one or more.
Can someone please correct me or confirm this thought? Thanks.
Michael
PS: I've also been thinking about the /o modifier. Would this be a good place to use it?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: most efficient regex to delete duplicate words
by blakem (Monsignor) on Aug 14, 2001 at 11:00 UTC |