Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Can't figure out how to invert this regex

by anniyan (Monk)
on Nov 25, 2005 at 14:41 UTC ( #511660=note: print w/ replies, xml ) Need Help??


in reply to Can't figure out how to invert this regex

You are using variable length in negative look behind, as per the perl regex tutorial perlre, we cannot use variable length in negative look behind condition. Rather we can use variable length in positive and negative look ahead.

updated:Thanks sauoq and apologises for the mistake.

Regards,
Anniyan
(CREATED in HELL by DEVIL to s|EVILS|GOODS|g in WORLD)


Comment on Re: Can't figure out how to invert this regex
Re^2: Can't figure out how to invert this regex
by Anonymous Monk on Nov 25, 2005 at 14:51 UTC
    Ah... so:

    s/&(?!.{2,10}?;)/REPLACED/g;
    Gives me what i need. Thanks.
Re^2: Can't figure out how to invert this regex
by sauoq (Abbot) on Nov 25, 2005 at 22:42 UTC
    Rather we can use variable length in positive look behind

    No, that's incorrect. Variable length patterns are supported in neither negative nor positive look-behind.

    -sauoq
    "My two cents aren't worth a dime.";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://511660]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2014-09-22 10:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (188 votes), past polls