Forum: Ruby UTF-8 regular expressions

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
91a9d8b37220f0b99c9c8b61ae61b212?d=identicon&s=25 Ben Lee (Guest)
on 2005-12-24 22:40
(Received via mailing list)
Hi,
   So I read the post from awhile back about packing multi-byte UTF-8
characters as octal:

r = Regexp.compile("ab\304\243cd", 0, "UTF-8")

or
  r = Regexp.compile("ab#{[0x123].pack('U')}cd", 0, "UTF-8")

So this seems to be a way to list out individual multi-byte UTF-8
characters
I was wondering if there's then a convenient way to specify a range of
UTF-8 characters?

For instance the darn
0x2002-2003
0x2013-2014
0x2018-201E
characters?

Thanks,
Ben
This topic is locked and can not be replied to.