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

Re: Modifying the match position after each match

by jacaril (Beadle)
on Mar 24, 2010 at 13:59 UTC ( #830573=note: print w/replies, xml ) Need Help??


in reply to Modifying the match position after each match

#! /usr/bin/perl -w use strict; use locale; my $string = "_'na'da_komo_el_'sol_"; $string =~ s/(_)'?(\w)/$1'$2/g; print "$string\n";
Output: _'na'da_'komo_'el_'sol_ Why even bother capturing the single quotes in the string that are were you want them when you're going to insert them anyway?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://830573]
help
Chatterbox?
[LanX]: http://web.archive .org/web/ 20071005212040/ http://www. everydevel.com:80/ index.pl?node= Everything %20Diagram
erix .oO( hm, tough beans )

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2017-11-20 21:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (294 votes). Check out past polls.

    Notices?