Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

wiki regex reprocessing replacement

by LanX (Saint)
on Feb 15, 2020 at 14:39 UTC ( [id://11112988]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
     DB<66> $_=$wiki; tf();tf();tf() ; print "'$wiki' \n=>\n'$_'" 
    '_*one /two/*_ _*three /four/*_ _*five /six/*_'
    =>
    '<u><b>one <i>two</i></b></u> <u><b>three /four/</b></u> <u><b>five <i
    +>six</i></b></u>'
     DB<67>
    
  2. or download this
     
      DB<40> %h = ( '*'=>'b', '/' => 'i' , '_' => 'u' ) 
    
    ...
    
      DB<65> $wiki='_*one /two/*_ _*three /four/*_ _*five /six/*_'
    
  3. or download this
      DB<90> sub tf { s{ $pre ([_*/]) (.*?) \2 (?=$post)}{$1<$h{$2}>$3</$h
    +{$2}>}xg }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-19 21:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found