in reply to Re: nbsp in space character class
in thread nbsp in space character class

\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