in reply to Any good ways to handle NARROW NO-BREAK SPACE characters in regex in newer versions of Perl?
\s matches whitespace characters, which includes U+202F NARROW NO-BREAK SPACE.
$ perl -le'print "\x{202F}" =~ /^\s\z/ ? "match" : "no match"' match
Do you have a NNBSP, or do you have its UTF-8 encoding? Don't forget to decode your inputs (and encode your outputs)!
If you need further help, please provide the output of sprintf( "%vX", $_ ) for a string that supposedly includes a NNBSP.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Any good ways to handle NARROW NO-BREAK SPACE characters in regex in newer versions of Perl?
by nysus (Parson) on Aug 13, 2024 at 15:57 UTC | |
by haukex (Archbishop) on Aug 13, 2024 at 16:02 UTC | |
by ikegami (Patriarch) on Aug 13, 2024 at 16:06 UTC |