Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (11)
As of 2015-07-06 10:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (71 votes), past polls