jimfog Posted February 12, 2015 Share Posted February 12, 2015 I am trying to use the brackets in a regular expression...see this example below: /^[A-Z]+$/i The above finds all English alphabet letters. I want to add also greek letters but js does not recognize greek letters so I want to add to the above pattern this: /[αάβγδεέζηήθιίϊΐκλμνξοόπρσςτυύϋΰφχψωώ]/i These above are the letters or the greek alphabet along with tones. How am I going to add the above letters in the code/pattern you see above? In other words I want the pattern to accept English and Greek characters....as it is now only English characters are matched. Link to comment Share on other sites More sharing options...
justsomeguy Posted February 12, 2015 Share Posted February 12, 2015 [A-Zαάβγδεέζηήθιίϊΐκλμνξοόπρσςτυύϋΰφχψωώ] Link to comment Share on other sites More sharing options...
jimfog Posted February 12, 2015 Author Share Posted February 12, 2015 [A-Zαάβγδεέζηήθιίϊΐκλμνξοόπρσςτυύϋΰφχψωώ] Yes it worked...thanks a lot. I had tried my self some things....but I had not though this one. Link to comment Share on other sites More sharing options...
justsomeguy Posted February 12, 2015 Share Posted February 12, 2015 Every character (with a few exceptions) that is listed in the square brackets is a valid character for the match. Exceptions are things like the hyphen that define a range of characters instead of an actual hyphen. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now