3

Possible Duplicate:
Regular expression to match non-english characters?

I am using this regex to limit some characters. I wanted to change this to allow all latin and non-latin letters but i think regex is not my think : )

String.prototype.isText2 = function () {return /^[\.\-\w\s&']*$/.test(this)}

This regex only allows latin chars and ' and & i think.

How can i make it allow non-latin letters ? (like these ç,ü,ğ,ş and chinese,japanese, arabic)

Community
  • 1
  • 1
Utku Dalmaz
  • 9,780
  • 28
  • 90
  • 130

2 Answers2

0

You can use XRegExp. This supports Unicode.

Mark Byers
  • 811,555
  • 193
  • 1,581
  • 1,452
0

You will need to work with unicode values. Please take a look at this previous SO thread for more information.

Community
  • 1
  • 1
npinti
  • 51,780
  • 5
  • 72
  • 96