tsvi has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I need to use regular expression for checking theinput of non english language. can I work with ascii values in my regular expretion. thanks Tsvi

Replies are listed 'Best First'.
Re: non english input validation
by pbeckingham (Parson) on Jul 01, 2004 at 13:04 UTC

    Yes, you can. If you provide a regex and sample strings, we can help.

Re: non english input validation
by hardburn (Abbot) on Jul 01, 2004 at 13:53 UTC

    This is highly non-trvial. It's easy to check for languages that don't share the same alphabet as English (they'll be using characters way outside the ASCII range), anything using Latin-1 is a lot harder. You might be able to find a stray accent mark, or see a few odd characters that are included in Latin-1 but aren't in English, but that's about it.

    ----
    send money to your kernel via the boot loader.. This and more wisdom available from Markov Hardburn.

Re: non english input validation
by ccn (Vicar) on Jul 01, 2004 at 13:45 UTC
    print 'non english' if m/[\x7B-\xFF]/;

      You're not seriously implying that the presence of eight-bit characters implies non-English, are you?

      That's just one end of the character set, and has nothing to do with language.