soumyapanda has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to replace all special characters in my data to its corresponding unicode value by using search and replace as follows
$data = "data ý ¶ data"; $data =~ s/([^\w\`\~\!\@\#\$\^\&\*\(\)\-\_\=\+\[\{\]\}\\\|\;\:\'\,\<\. +\>\/\?\x22\xA0\s\x25\xA9\xA7])/ord($1)/g;
But the output is : data ord(ý) ord(¶) data
Please suggest as how do we use ord as function in search and replace.Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: replace special character with its unicode
by choroba (Cardinal) on Nov 14, 2011 at 17:07 UTC | |
|
Re: replace special character with its unicode
by Anonymous Monk on Nov 14, 2011 at 11:45 UTC | |
by Ea (Chaplain) on Nov 14, 2011 at 13:11 UTC | |
|
Re: replace special character with its unicode
by ikegami (Patriarch) on Nov 14, 2011 at 19:23 UTC |