My guess to your meaning would be:
print $2 while 'abccabbcabc' =~ m[(c).*?(\1)]g;; c c
As for your purpose, that's beyond me. Care to enlighten us?
In reply to Re: Regex to only show 2nd character of the same character in a string
by BrowserUk
in thread Regex to only show 2nd character of the same character in a string
by wtritchie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |