Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: regex for negating a sequence

by davidrw (Prior)
on Oct 03, 2006 at 18:10 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://576141]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-03-29 09:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found