Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Matching a pattern in Regex

by Ieronim (Friar)
on Jul 25, 2006 at 10:28 UTC ( [id://563469]=note: print w/replies, xml ) Need Help??


in reply to Matching a pattern in Regex

You need the /e switch in substitution.
Use smth like
s{<figr n="([^"]+)">(.*?)</figr>} {'<FIGIND NUM="'.$1.'" ID="FG.'.sprintf("%03d", $1).'">'.$2.'</FIGIND> +'}eg;
instead of the snippet you have shown.

     s;;Just-me-not-h-Ni-m-P-Ni-lm-I-ar-O-Ni;;tr?IerONim-?HAcker ?d;print

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://563469]
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: (3)
As of 2024-04-24 18:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found