Just hours ago I found the :with options of helpers like
validates_format_of seems UTF-8 compatible (for instance, “/.{2}/”
matches exactly two UTF-8 characters instead of a length 2 UTF-8
string). I am wondering if there are any documentation about this UTF-8
compatible methods? Are there any UTF-8 compatible regex engine in ruby
itself? TIA!
Ruby has kind-of UTF-8 compatible regexp: single character matches
single UTF-8 character (when given UTF-8 encoding directive, which is
default in Rails), not single byte. But character classes, such as
[:alfa:], work only for ASCII. For general UTF-8 regex with character
classes, you can use Oniguruma gem…
izidor
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.