1 2 3 Previous Next 39 Replies Latest reply: May 7, 2007 11:56 AM by 796440 RSS

    What's the regex pattern for regular English chars and numbers ...

      In Java String there is a matches(String regex) method, how can I specify the regex for regular English chars, I want it to tell me if the string contains non-English chars. The string is from an email, my application wants to know if the email contains any foreign characters, such as French, Spanish, Chinese ...

      So if the string looks like this : "Hi Frank, today is (5-7-2007), my address is : 'abc@xyz.com', email me ~ ! ^_^, do you know 1+2=3 ? AT&T, 200%, *[$300] | {#123}, / _ \;"

      It should recognize it as regular English characters.

      But if it contains any foreign language (outside of a-z) chars either western(Russian, Greek ...) or eastern languages (Japanese, Chinese ...), it should return false.

      I wonder how to write this "regex" ?

        1 2 3 Previous Next