Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: A regex that only matches at offset that are multiples of a given N?

by tobyink (Abbot)
on Feb 16, 2013 at 07:57 UTC ( #1019020=note: print w/replies, xml ) Need Help??


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?

/(?(?{pos() % 2 == 0})(b[xyz]))/g

I think you want to explicitly back-track in the no condition...

/(?(?{pos() % 2 == 0})(b[xyz])(*FAIL))/g
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1019020]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2017-06-26 17:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (583 votes). Check out past polls.