1

I am developing an application in Arabic-English language, so i needed a Regex that validates to a set of separated words, here is my RegEx:

^([a-zA-Z]+(,[a-zA-Z]+)*)?$

This works flawless for me but as you see the charters specified is in English, i want this for Arabic language.

Can this expression be altered to accept other charters either Arabic or even maybe some other language ?

ykh
  • 1,775
  • 3
  • 31
  • 57

1 Answers1

2

Instead of restricting to a set of alphabetical character, exclude the characters that mark the end of your word.

^([^,]+(,[^,]+)*)?$

If you really want to match Arabic characters, see: regular expression For Arabic Language

Community
  • 1
  • 1
Gabriel S.
  • 1,961
  • 2
  • 20
  • 30