Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: regex for negating a sequence

by davidrw (Prior)
on Oct 03, 2006 at 18:10 UTC ( #576141=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    /\x26\x67(?!\x26\x67)(.(?!\x26\x67)){6}.{2}/s
    
  2. or download this
     perl -le 'print for map { /ab(?!ab)(.(?!ab)){2}.{2}/s ? $& : () } @AR
    +GV' abhjabdf abasdasd abdasdadsab ababblah
    OUTPUTS:
    abasda
    abdasd
    abblah
    
  3. or download this
      /
        \x26\x67     # Starting sequence (let's call it AB)
    ...
                     # note we know they're not AB because otherwise the
                     # (N-2)th item in the previous part wouldn't have mat
    +ched
      /sx            # Enable comments, and make . mean everything
    
  4. or download this
      my $marker = '&g';
      my $N = 8;
      my $n1 = $N-2;
      /$marker(?!$marker)(?:.(?!$marker)){$n1}.{2}/s
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2019-07-21 12:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If you were the first to set foot on the Moon, what would be your epigram?






    Results (8 votes). Check out past polls.

    Notices?