Question

I want to find x0027; this and change to x2019; hexadecimal value in a string;

I tried :

$string =~s/\x{0027}/\x{2019}/g;

but not working

Kindly anyone give some suggestion to solve this

Thanks

Was it helpful?

Solution

No need of \ or { } brackets.

$string =~ s/x0027/x2019/g;

OTHER TIPS

Remove the curly brackets:

$string =~s/\x0027/\x2019/g;

or if there're present in the original string, escape them:

$string =~s/\x\{0027\}/\x\{2019\}/g;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top