Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Unicode characters in RegExp

Reply
Thread Tools

Unicode characters in RegExp

 
 
Ron Brennan
Guest
Posts: n/a
 
      11-21-2004
I'm trying to test a character for not being uppercase, including Unicode
Latin-1.

The following JavaScript expression doesn't work. It is embedded in a
servlet that targets IE 5 or later.

if (/[^A-Z \u00C0-\u00D6 \u00D8-\u00DF]/.test(stest))

Probably something obvious to those of you working with RegExp more than me.

Thanks,
Ron



 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      11-21-2004
Ron Brennan wrote on 21 nov 2004 in comp.lang.javascript:

> I'm trying to test a character for not being uppercase, including
> Unicode Latin-1.
>
> The following JavaScript expression doesn't work. It is embedded in a
> servlet that targets IE 5 or later.
>
> if (/[^A-Z \u00C0-\u00D6 \u00D8-\u00DF]/.test(stest))
>
> Probably something obvious to those of you working with RegExp more
> than me.


Works fine here [btw, leave the spaces out]

stest='é'
alert(/[^A-Z\u00C0-\u00D6\u00D8-\u00DF]/.test(stest))

stest='É'
alert(/[^A-Z\u00C0-\u00D6\u00D8-\u00DF]/.test(stest))

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

 
Reply With Quote
 
 
 
 
Ron Brennan
Guest
Posts: n/a
 
      11-21-2004
> Works fine here [btw, leave the spaces out]
>
> stest='é'
> alert(/[^A-Z\u00C0-\u00D6\u00D8-\u00DF]/.test(stest))
>
> stest='É'
> alert(/[^A-Z\u00C0-\u00D6\u00D8-\u00DF]/.test(stest))
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress,
> but let us keep the discussions in the newsgroup)


Works fine here too, once I commented out the part of the program that was
causing the problem.

Thanks again Evertjan,
Ron



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Python unicode utf-8 characters and MySQL unicode utf-8 characters Grzegorz Śliwiński Python 2 01-19-2011 07:31 AM
[regexp] How to convert string "/regexp/i" to /regexp/i - ? Joao Silva Ruby 16 08-21-2009 05:52 PM
Re: convert unicode characters to visibly similar ascii characters Laszlo Nagy Python 6 07-02-2008 04:42 PM
Re: convert unicode characters to visibly similar ascii characters M.-A. Lemburg Python 0 07-02-2008 08:39 AM
Re: convert unicode characters to visibly similar ascii characters Terry Reedy Python 0 07-01-2008 07:46 PM



Advertisments