Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change RegEx to allow for both English & Japanese characters

Tags:

jquery

regex

php

This is my regular expression code:

"onlyLetterSp": {
    "regex": /^[a-zA-Z\ \']+$/,
    "alertText": "* Letters only"
}

How can I change this to allow English characters as well as Japanese?

like image 790
Ketan patil Avatar asked Mar 01 '13 05:03

Ketan patil


1 Answers

I found this link:

http://www.localizingjapan.com/blog/2012/01/20/regular-expressions-for-japanese-text/

There are apparently a few different character sets for different types of Japanese.

Hiragana for example is:

[\x3041-\x3096]
like image 124
Emery King Avatar answered Oct 24 '22 12:10

Emery King