diff --git a/basis/regexp/parser/parser.factor b/basis/regexp/parser/parser.factor index 0025b89d56..a038351cb0 100644 --- a/basis/regexp/parser/parser.factor +++ b/basis/regexp/parser/parser.factor @@ -133,7 +133,7 @@ CharacterInBracket = !("}") Character QuotedCharacter = !("\\E") . Escape = "p{" CharacterInBracket*:s "}" => [[ s name>class ]] - | "P{" CharacterInBracket*:s "}" => [[ s name>class ]] + | "P{" CharacterInBracket*:s "}" => [[ s name>class ]] | "Q" QuotedCharacter*:s "\\E" => [[ s ]] | "u" Character:a Character:b Character:c Character:d => [[ { a b c d } hex> ensure-number ]] diff --git a/basis/regexp/regexp-tests.factor b/basis/regexp/regexp-tests.factor index 1f72fa04ba..2488f568da 100644 --- a/basis/regexp/regexp-tests.factor +++ b/basis/regexp/regexp-tests.factor @@ -530,3 +530,8 @@ IN: regexp-tests [ f ] [ "π" R/ [\p{script=latin}--\p{lower}]/ matches? ] unit-test [ t ] [ "A" R/ [\p{script=latin}--\p{lower}]/ matches? ] unit-test [ f ] [ "3" R/ [\p{script=latin}--\p{lower}]/ matches? ] unit-test + +[ t ] [ " " R/ \P{alpha}/ matches? ] unit-test +[ f ] [ "" R/ \P{alpha}/ matches? ] unit-test +[ f ] [ "a " R/ \P{alpha}/ matches? ] unit-test +[ f ] [ "a" R/ \P{alpha}/ matches? ] unit-test