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 (Chaplain)
on Oct 01, 2012 at 19:56 UTC ( [id://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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-20 00:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found