in reply to Re: Re: Re: Regex help
in thread Regex help
To get even elements instead of odd elements, you just start with the magic wand in the other position:$| = 1; print grep --$|, /\b(\w+)\b(?=(.*?)\b\1\b)/g'
or:print grep --$|,($|&&=0)|| /\b(\w+)\b(?=(.*?)\b\1\b)/g'
Why ||= and &&= instead of = is left as an excercise for the reader. Hope that clears things up for you :)$| = 0; print grep --$|, /\b(\w+)\b(?=(.*?)\b\1\b)/g'
|
|---|