-3

I have a text field in which I have to accept only 2 bytes accented characters, in whatever language it is. i.e. whether it is french, german, spanish, etc.

I used this regex : /^[A-zÀ-ÿ\\s]*$/

But it does not accept the character : ¢

Thanks in advance

Pete
  • 51,385
  • 23
  • 99
  • 140
Beutiful World
  • 59
  • 1
  • 3
  • 11
  • What did you try? Where did you fail? What exactly are you trying to match? – npinti Jul 15 '15 at 07:11
  • 1
    This requires SOME effort, but I can give you a [hint](https://github.com/slevithan/xregexp/blob/master/src/addons/unicode/unicode-categories.js). Also, here is [a regex matching as well all Unicode letters](http://stackoverflow.com/a/31115742/3832970) that can help you. – Wiktor Stribiżew Jul 15 '15 at 07:13
  • I got the solution to be added in javascript. Thanks in advance – Beutiful World Jul 15 '15 at 10:58
  • What should i do ? Should i delete this question from stackoverflow – Beutiful World Jul 15 '15 at 10:58

1 Answers1

0

I got the solution from other source. it can be done without regular expression also.

Javascript function is created which calculates the bytes for each character. and validate if it more than 2 bytes or not.

Beutiful World
  • 59
  • 1
  • 3
  • 11