Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: regex to remove a word from string

by mendeepak (Scribe)
on Dec 04, 2014 at 05:55 UTC ( [id://1109202] : note . print w/replies, xml ) Need Help??


in reply to regex to remove a word from string

I do not know whether this is a correct approach.

$str = "auth_plugin_stack = a,b,EXT::USCC::USCCAuth,c,d"; print "$str \n"; $str =~ s/((\w+::)+\w+,)//; print "$str \n";
answer:
auth_plugin_stack = a,b,EXT::USCC::USCCAuth,c,d auth_plugin_stack = a,b,c,d