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

Re: how to do replace more then one matches?

by AnomalousMonk (Canon)
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'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1036787]
help
Chatterbox?
[Corion]: Two-way data binding means that if you change something in a text box, the corresponding variable in your Javascript gets updated immediately as well, and if you then change the variable, the corresponding text box also gets updated
[Corion]: That is a horrible approach that was also taken by Access, but if you have hooks that prevent automatic saving to the database, it is incredibly handy

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2017-03-30 07:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (355 votes). Check out past polls.