2

I have a regex that is used for matching unicode string and works pretty cool with all versions of Ruby newer than 1.8.7:

/[\p{L}\p{Space}]+/u

How it can be achieved with Ruby 1.8.7?

Sergey Kishenin
  • 5,099
  • 3
  • 30
  • 50

1 Answers1

1

Unicode properties were added in Ruby with version 1.9, so in older versions you have to use Posix classes like [:space:] or [:alpha:]

See POSIX Bracket Expressions for more details.

stema
  • 90,351
  • 20
  • 107
  • 135