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
  • 8,957
  • 27
  • 87
  • 124

2 Answers2

0

You can use XRegExp. This supports Unicode.

Mark Byers
  • 767,688
  • 176
  • 1,542
  • 1,434
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,070
  • 5
  • 71
  • 94