regex - Match unicode text with Ruby 1.8.7 -
i have regex used matching unicode string , works pretty cool versions of ruby newer 1.8.7:
/[\p{l}\p{space}]+/u
how can achieved ruby 1.8.7?
unicode properties added in ruby version 1.9, in older versions have use posix classes [:space:]
or [:alpha:]
see posix bracket expressions more details.
Comments
Post a Comment