in reply to Regex to only show 2nd character of the same character in a string

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?


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP an inspiration; A true Folk's Guy
  • Comment on Re: Regex to only show 2nd character of the same character in a string
  • Download Code