Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Japanese Regex (Ruby on Rails)



On mercredi 22 avr. 09, at 09:34, Patrick Niessen wrote:

Hi everyone,

I am trying to find the Japanese / Unicode equivalent for the
following Regular Expression, to verify web form input:

validates_format_of :screen_name,
 :with =>/^[A-Z0-9._]*$/i,
:message => "must contain only letters, numbers and undescore % or dots."

My guess is, that normal characters live within a defined range so I
suppose one only needs to check whether the submitted forms parameter
are within that range.

Check that page:

http://www.regular-expressions.info/unicode.html

There are Unicode properties that can be used pretty much as character classes in regex.





Jean-Christophe Helary



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links