I'm making a french verb conjugation Rails website where users may insert conjugations of verbs like:
se abstenir
m'appelle
êtes
achète
And I need to validate_format_of those verbs. The apostrophes are quite easy, but what about the êèã characters?
By now I have:
word_format = /\A[\w]+[' ]?[\w]*\z/
validates_format_of (...), :with => word_format
Which clearly doesn't work since \w doesn't match them. Also including áêĩ(...) to the regexp gives me a invalid multibyte char (US-ASCII) error.
I also need to upcase of downcase those strings, which ruby is ignoring, resulting in 'VOUS êTES' for example. The trivial answer seems to be doing it by hand, but I hope Ruby/Rails to surprise me again.
Its seems to be a hard problem, and I wasn't expecting since Ruby/Rails power.
Anybody could give me a clue?