Reputation: 249
From this string pattern:
"test A dkdkd荴kdklsl skldsls荴lksdkdk skdkd荴kdkls";
I am trying to remove this character 荴 from the entire row..
I tried this solution but it only remove the 荴 at the end of the row and not if it contains more than occurrence of it on the same row:
$removeU8374 =~ s/^(test A .*)\N{U+8374}/$1/;
I even tried this but still removed only one occurrence of it and not remove all occurrence of 荴 character from the entire row:
$removeU8374 =~ s/^(test A .*)\N{U+8374}/$1/g;
Upvotes: 1
Views: 69
Reputation: 36402
If you want to remove it everywhere, ignore the rest of the string in your substitution, eg.
$removeU8374 =~ s/\N{U+8374}//g;
Otherwise, you can loop on your substitution until it no longer matches.
Upvotes: 1