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

有帮助吗?

解决方案

No need of \ or { } brackets.

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

其他提示

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;
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top