i’m looking for a regular expression to validate an input :
in France, we can use accented characters in name, and i don’t find anything i can use.
please, can you help me to find how to do a regular expression for:
-any letter
-any accented letter
-spaces
– and the sign “-” (without quotes)
i’ve try something like but it don’t seem to be working..
var regealpha =/[^A-Za-z0-9ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ]/;
thx for help (and sorry for my poor english… i’m a froggy ^^ )
JavaScript doesn’t seem to have good internationalization options. The symbol \w will give you all [A-Za-z0-9_], but you’ll need to stipulate your own chars in addition to this.
You seem to be quite close. The following regex should work for you:
See it working at this jsfiddle:
http://jsfiddle.net/jameswiseman/3H2mJ/1/
You’ll see that the regex replaces everything in the input string
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ"with ‘z’.EDIT
I think this is what you need:
It will tell you if there are characters NOT in the above set. So
Also have a look at this JSFiddle
I know it is long, but if that is what is needed then then you should use it.