You want capture and lookahead, print $2, $/ while /(\b\w+\b)(?=(.*?)\1)/g; \1 there is the form of backreference needed in regexen.
After Compline,
Zaxo
In reply to Re: Regex help
by Zaxo
in thread Regex help
by toonski
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |