The stupid question is the question not asked | |
PerlMonks |
Re: Escaping multiple escape charsby l.frankline (Hermit) |
on Dec 10, 2005 at 04:45 UTC ( [id://515687]=note: print w/replies, xml ) | Need Help?? |
If you are working in regular expressions, non-alphanumeric characters are recognised • perl operators or Lets take a look at your problem. \ (backslash is a non-alphanumeric character). \\ (in regular expression, two backslashs are recognised as single backslash) while trying the below segment... $txt=~s/\\/\\\\/g; \\\\ (FOUR backslashs becomes 2 backslashs) therefore your results will be... __\\U//__ For your desired output try the below one:
regards Don't put off till tomorrow, what you can do today.
In Section
Seekers of Perl Wisdom
|
|