in reply to Re^4: Problems searching and highlighting proximity words in a text
in thread Problems searching and highlighting proximity words in a text
The $4 seems not to be necessary,
Indeed, as long as you use
(?:\w+\W+){0,$distance}
instead of the expression I've used,
(\w+\W+){0,$distance}
there will be no extra match. I haven't done any benchmarking, but probably the lookahead is a bit better/faster anyway.
Indeed, as long as you use
(?:\w+\W+){0,$distance}
instead of the expression I've used,
(\w+\W+){0,$distance}
there will be no extra match. I haven't done any benchmarking, but probably the lookahead is a bit better/faster anyway.
In Section
Seekers of Perl Wisdom