in reply to inconsistency in whitespace handling
Interestingly enough, if you use a named parameter class instead of a the \s assertion, it finds it correctly in both strings.
$ascii = "\xa0\x{a0}"; $unicode = "\x{100}\xa0\x{a0}"; print "Latin-1 \\s : ", $ascii =~ /\s/ ? "yes":"no","\n"; print "Latin-1 \\p{Space}: ", $ascii =~ /\p{Space}/ ? "yes":"no","\n +\n"; print "Unicode \\s: ",$unicode =~ /\s/ ? "yes":"no","\n"; print "Unicode \\p{Space}: ",$unicode =~ /\s/ ? "yes":"no","\n";
I certainly wouldn't expect non-breaking space to be recognized or not as a space depending on what else was in the string.
(I even experimented with whether the enclosing brackets were significant... apparantly not.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: inconsistency in whitespace handling
by Fletch (Bishop) on May 12, 2005 at 14:45 UTC | |
by demerphq (Chancellor) on May 13, 2005 at 11:18 UTC |