Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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?
[virtualsue]: Aha. My crawler didn't deal properly with hrefs starting with ?
[Discipulus]: 1nickt maybe 'cause you ignore what happened in middleage in real monasteries... ;=)
[Corion]: virtualsue: Aaah, yes, we do use these a lot

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2017-12-13 13:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (368 votes). Check out past polls.

    Notices?