Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Text switching

by htmanning (Friar)
on Sep 13, 2022 at 01:31 UTC ( [id://11146840]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $digits_4 = qr{ (?<!-)\b[0-9]{4}\b(?!-) }xms;
    $text =~ s{ ($digits_4) }
              {<a href="apartments.pl?do_what=view&unit=$1"><b>$1</b></a>}
    +xmsg;
    
  2. or download this
    $unitslist_4 = "1001,1002,1003,1004,1101,1102,1103,1104,1201,1202,1203
    +,1204,1301,1302,1303,1304,1401,1402,1403,1404,
    1501,1502,1503,1504,1601,1602,1603,1604,1701,1702,1703,1704,1801,1802,
    +1803,1804,1901,1902,1903,1904,2001,2002,2003,2004,
    ...
    $text =~ s{ ($digits_4) }
              {<a href="apartments.pl?do_what=view&unit=$1"><b>$1</b></a>}
    +xmsg;
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11146840]
Approved by kcott
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-25 14:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found