Regex to validate letters, spaces and unicode characters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Scott
    New Member
    • Oct 2012
    • 2

    Regex to validate letters, spaces and unicode characters

    Hi,

    Could you guys help me to add this pattern: `[\u0000-\u0080]`
    into the following regex: `/^[a-zA-Z\ \']+$/` ?

    The above regex allows only letters and spaces, and I would like it to additionaly allow text if it has the above unicode pattern also (but its not required).

    Regards.
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    there’s no need to combine the first and the second RegExp. the second is already a part of the first (ASCII).

    Comment

    • Scott
      New Member
      • Oct 2012
      • 2

      #3
      I dont think so, the
      Code:
      /^[a-zA-Z\ \']+$/
      will pass such words like "Test test" or "test Test", but IT WOULDNT pass special characters (unicode) like "Łądsc Ęsć" .. and I would like to allow that too.

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        then you would need to extend the character class beyond \u0080.

        Comment

        Working...