Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

by Polyglot (Pilgrim)
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?
What's the matter? Cat got your tongue?...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (12)
As of 2016-12-05 16:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (88 votes). Check out past polls.