in reply to Re: A regex that only matches at offset that are multiples of a given N?
in thread A regex that only matches at offset that are multiples of a given N?
Ah! Almost(*) perfect. (I never have wrapped my brain around \G :( )
print "$-[0]: $1" while $a =~ m[\G(?:.{4})*?(?=(aa..))]g;; 0: aawx 404: aawx print "$-[0]: $1" while $a =~ m[\G(?:.{4})*?(?=(gg..))]g;; 0: gghn 208: gghn
(*)I wasn't seeing the double matching; but now I am. Then I thought moving the \G would fix it, but it doesn't :( )
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: A regex that only matches at offset that are multiples of a given N? (Update:almost perfect!)
by smls (Friar) on Feb 13, 2013 at 17:52 UTC | |
by BrowserUk (Patriarch) on Feb 13, 2013 at 18:45 UTC | |
by smls (Friar) on Feb 13, 2013 at 19:29 UTC | |
by BrowserUk (Patriarch) on Feb 13, 2013 at 20:11 UTC | |
by smls (Friar) on Feb 13, 2013 at 21:11 UTC | |
|