Do these two substitutions always yield the same results?
$data =~ s/\p{Space}//g;
$data =~ s/[\h\v]//g;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes.
Contrast with
\smight start including U+000B soon, though.unicharsis installed by Unicode::Tussle.Note: Without
/uoruse 5.012;,\ssometimes doesn’t match NBSP.I just found a bug in Perl (5.16.0). Reporting it immediately.
So that means, no,
\p{Space}and[\h\v]are only equivalent if/uoruse 5.012;is used.Ticket #114220
Status:
/\h/is equivalent to/[\h]/in 5.10, 5.12, 5.14 and 5.18/\h/is not equivalent to/[\h]/in 5.16.0