Welcome to the Monastery | |
PerlMonks |
Re: Regex: remove non-adjacent duplicate hashtags (updated)by haukex (Archbishop) |
on Jul 23, 2022 at 13:10 UTC ( [id://11145666]=note: print w/replies, xml ) | Need Help?? |
You need to use \1 instead of $1, see perlre. You may also want to move the \s? out of the capture group. Update: Plus, what LanX said about using a lookahead!
In Section
Seekers of Perl Wisdom
|
|