\s also matches it, but only if perl has the string marked as utf8
As shown below.
use HTML::Entities qw( decode_entities ); my $ch = decode_entities(' '); print("Unicode Semantics\n"); print("-----------------\n"); utf8::upgrade($ch); if ($ch =~ /\s/) { print("Match\n"); } else { print("No Match\n"); } print("\n"); print("Byte Semantics\n"); print("--------------\n"); utf8::downgrade($ch); if ($ch =~ /\s/) { print("Match\n"); } else { print("No Match\n"); }
Unicode Semantics ----------------- Match Byte Semantics -------------- No Match
In reply to Re^2: nbsp in space character class
by ikegami
in thread nbsp in space character class
by hsfrey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |