Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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

by smls (Friar)
on Feb 13, 2013 at 23:35 UTC ( [id://1018660]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #      0    5   10   15   20   25   30   35
    #      '    '    '    '    '    '    '    '
    $_ = q{.....fred1..fred2...fred3....fred4..};
    ...
        say "  matched 'fred$1' at pos @{[pos($_)-$n]} (gobbled '$&')";
      }
    }
    
  2. or download this
    $n = 4
      matched 'fred2...' at pos 12 (gobbled '.....fred1..fred')
    ...
    $n = 5
      matched 'fred1..' at pos 5 (gobbled '.....fred1')
      matched 'fred3....' at pos 20 (gobbled '..fred2...fred3')
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-24 01:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found