[Bug 1267005] New PW containing the special character "=?UTF-8?Q?=C2=A7?=" is rejected
bugzilla at redhat.com
bugzilla at redhat.com
Wed Sep 30 09:12:00 UTC 2015
https://bugzilla.redhat.com/show_bug.cgi?id=1267005
Petr Pisar <ppisar at redhat.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ppisar at redhat.com
--- Comment #11 from Petr Pisar <ppisar at redhat.com> ---
(In reply to Matt Tyson from comment #9)
> (In reply to joerg.lechner from comment #8)
> > keyboard (a German keyboard) in the line !"§$%&/()=?`, I myself assume, I
> > can use all characters in this line to meet the PW requirements.
>
> Ahh that makes more sense now. Bugzilla uses a perl [[:punct:]] regex to
> determine the characters ( http://perldoc.perl.org/perlrecharclass.html ).
> It doesn't consider that character to be punctuation.
>
[[:punct::]] is alias for \p{PosixPunct} in ASCII range. POSIX does not
consider the `§' as a punctuation.
Please read perlrecharclass POD, especially note #5:
[5] "\p{PosixPunct}" and "[[:punct:]]" in the ASCII range match all
non-controls, non-alphanumeric, non-space characters:
"[-!"#$%&'()*+,./:;<=>?@[\\\]^_`{|}~]" (although if a locale is in
effect, it could alter the behavior of "[[:punct:]]").
The similarly named property, "\p{Punct}", matches a somewhat
different set in the ASCII range, namely
"[-!"#%&'()*,./:;?@[\\\]_{}]". That is, it is missing the nine
characters "[$+<=>^`|~]". This is because Unicode splits what POSIX
considers to be punctuation into two categories, Punctuation and
Symbols.
"\p{XPosixPunct}" and (under Unicode rules) "[[:punct:]]", match what
"\p{PosixPunct}" matches in the ASCII range, plus what "\p{Punct}"
matches. This is different than strictly matching according to
"\p{Punct}". Another way to say it is that if Unicode rules are in
effect, "[[:punct:]]" matches all characters that Unicode considers
punctuation, plus all ASCII-range characters that Unicode considers
symbols.
Probably you want to match against \p{Punct} or switch to Unicode semtantics:
$ perl -e 'q{§} =~ /[[:punct:]]/ and print qq{match\n}'
$ perl -e 'q{§} =~ /[[:punct:]]/a and print qq{match\n}'
$ perl -e 'q{§} =~ /[[:punct:]]/u and print qq{match\n}'
match
$ perl -e 'q{§} =~ /\p{PosixPunct}/ and print qq{match\n}'
$ perl -e 'q{§} =~ /\p{XPosixPunct}/ and print qq{match\n}'
match
$ perl -e 'q{§} =~ /\p{Punct}/ and print qq{match\n}'
match
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the perl-devel
mailing list