Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

How to use "less than" and "greater than" inside a regex for a $variable number

by Polyglot (Monk)
on Oct 01, 2012 at 19:56 UTC ( #996728=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $replace = sub { 
        push @findmissing, "$bookabbrev\t$1\t$2\t$3\n"; 
    ...
    
    s/$before.*?(.{0,25})(?<!\d)($missingpages[$_])(?>\D)(.{0,25}).*?$afte
    +r/$replace->()/eg for @source;
    }
    
  2. or download this
    GC      kes."--Wylie, b. 16, ch.   1        Did this haughty potenta
    GC      rty."--Wylie, b. 16, ch.   1        This document clearly re
    
  3. or download this
        s/
        (??{$missingpages[$_]-1|$missingpages[$_]-2|$missingpages[$_]-3|$m
    +issingpages[$_]-4|$missingpages[$_]-5|$missingpages[$_]-6})
    ...
        .*?
        (??{$missingpages[$_]+1|$missingpages[$_]+2|$missingpages[$_]+3|$m
    +issingpages[$_]+4|$missingpages[$_]+5|$missingpages[$_]+6})
        /$replace->()/egx for @source;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://996728]
Approved by Corion
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 2014-12-29 01:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (183 votes), past polls