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

Re: regex related...search and delete

by choroba (Chancellor)
on Jan 14, 2013 at 10:32 UTC ( #1013181=note: print w/replies, xml ) Need Help??


in reply to regex related...search and delete

You can use a simple substitution. [LW] is a character class containing both L and W, the final /g is needed to replace both the letters.
$string = "(L 2 W 7)"; $string =~ s/[LW] //g; # Replace L or W followed by a space by nothing +. print $string, "\n";
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: regex related...search and delete
by freekngeek (Acolyte) on Jan 14, 2013 at 10:41 UTC
    Thanks a lot man. it's working :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1013181]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2016-12-06 09:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (101 votes). Check out past polls.