Re: Checking that user has entered a word or words in text input form using regular expressions...
- From: "Luke Matuszewski" <matuszewski.lukasz@xxxxxxxxx>
- Date: 18 Apr 2006 12:17:55 -0700
Lasse Reichstein Nielsen wrote:
RobG <rgqld@xxxxxxxxxxxx> writes:
Lasse Reichstein Nielsen said on 18/04/2006 4:06 PM AEST:
or if what you want is what the Unicode specification calls "Alphabetic".
See <URL:http://www.unicode.org/Public/UNIDATA/DerivedCoreProperties.txt>
(You can also see why it's something of a mouthful to create a regexp
for it :)
If that is the requirement, why not:
if ( !/\d/.test(inputValue) )
{
// inputValue doesn't have any digits
Because there's more (much more) to Unicode than letters and digits.
In the file linked, the Grapheme_Base and Math groups contains symbols
that are neither digit nor letter. Take, e.g., codepoint 0x3251:
"circled numer twenty one", or 0x4dc0 "Hexagram for the creative
heaven". :)
There are Unicode letters and Unicode blocks (like InMongolian). For
better understanding what i really mean please read "Unicode support"
paragraph in the followin URL:
<URL:http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html>
(see also: http://www.unicode.org/unicode/reports/tr18/ ).
I did not checked the ECMAScript 4 proposal/standard track, but they
should 'upgrade' regular expressions to support Classes for Unicode
blocks and categories.
Best regards
Luke M.
.
- References:
- Checking that user has entered a word or words in text input form using regular expressions...
- From: Luke Matuszewski
- Re: Checking that user has entered a word or words in text input form using regular expressions...
- From: Lasse Reichstein Nielsen
- Re: Checking that user has entered a word or words in text input form using regular expressions...
- From: RobG
- Re: Checking that user has entered a word or words in text input form using regular expressions...
- From: Lasse Reichstein Nielsen
- Checking that user has entered a word or words in text input form using regular expressions...
- Prev by Date: Determining the location of an element with focus
- Next by Date: Are JavaScript strings mutable?
- Previous by thread: Re: Checking that user has entered a word or words in text input form using regular expressions...
- Next by thread: Re: Checking that user has entered a word or words in text input form using regular expressions...
- Index(es):
Relevant Pages
|
Loading