A
Ammar Ali
[Note: parts of this message were removed to make it a legal post.]
On 1.9.2, I'm seeing an "invalid character property name" error from Regexp
for the named properties Any, Ascii, and Xdigit, but none of the others. If
I add the u option to the expression, it works.
# All good, with or without u option
[ 'Alnum', 'Alpha', 'Blank', 'Cntrl', 'Digit', 'Graph', 'Lower',
'Print', 'Punct', 'Space', 'Upper', 'Word'
].each {|name| puts /\p{#{name}}/ }
# Errors raised without u option
['Any', 'Ascii', 'Xdigit'].each {|name| puts /\p{#{name}}/ }
# Now it's good
['Any', 'Ascii', 'Xdigit'].each {|name| puts /\p{#{name}}/u }
I expected that all the names would either require the u option, or they
wouldn't. If it was just Any and Ascii, I would accept it and move on, but
Xdigit doesn't seem to belong with the other two.
Trying to understand why Any, Ascii, and Xdigit are "special". Any clues
greatly appreciated.
Thanks,
Ammar
On 1.9.2, I'm seeing an "invalid character property name" error from Regexp
for the named properties Any, Ascii, and Xdigit, but none of the others. If
I add the u option to the expression, it works.
# All good, with or without u option
[ 'Alnum', 'Alpha', 'Blank', 'Cntrl', 'Digit', 'Graph', 'Lower',
'Print', 'Punct', 'Space', 'Upper', 'Word'
].each {|name| puts /\p{#{name}}/ }
# Errors raised without u option
['Any', 'Ascii', 'Xdigit'].each {|name| puts /\p{#{name}}/ }
# Now it's good
['Any', 'Ascii', 'Xdigit'].each {|name| puts /\p{#{name}}/u }
I expected that all the names would either require the u option, or they
wouldn't. If it was just Any and Ascii, I would accept it and move on, but
Xdigit doesn't seem to belong with the other two.
Trying to understand why Any, Ascii, and Xdigit are "special". Any clues
greatly appreciated.
Thanks,
Ammar