Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: how to do replace more then one matches?

by AnomalousMonk (Monsignor)
on Jun 03, 2013 at 15:06 UTC ( #1036787=note: print w/ replies, xml ) Need Help??


in reply to how to do replace more then one matches?

Maybe something like (note the  s///g regex modifier):

>perl -wMstrict -le "my $s = 'xyz table 1 table tablet table2 fig 3 fig figer fig4 zyx'; print qq{'$s'}; ;; $s =~ s{ (?= (?: table | fig) \s* \d+) }{<aid=}xmsg; # <-- note /g m +odifier print qq{'$s'}; " 'xyz table 1 table tablet table2 fig 3 fig figer fig4 zyx' 'xyz <aid=table 1 table tablet <aid=table2 <aid=fig 3 fig figer <aid=f +ig4 zyx'


Comment on Re: how to do replace more then one matches?
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1036787]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2014-08-21 15:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (136 votes), past polls