473,414 Members | 1,615 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Unicode characters in RegExp

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

Jul 23 '05 #1
2 2499
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)

Jul 23 '05 #2
> 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

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: marek | last post by:
trying this example to make print MatchObject reference. Fails (prints None). Does anybody know where I am wrong? # -*- coding: cp1251 -*- import re # pattern in Ukrainian ('привіт') p = ...
2
by: mike blamires | last post by:
I am having great difficulty using Unicode characters in a Regular Expression, I am trying to match extended Unicode characters. I am wishing to split a large Dumpfile (containing only JPEGS) I...
48
by: Zenobia | last post by:
Recently I was editing a document in GoLive 6. I like GoLive because it has some nice features such as: * rewrite source code * check syntax * global search & replace (through several files at...
4
by: Basil | last post by:
Hello. I have compiler BC Builder 6.0. I have an example: #include <strstrea.h> int main () { wchar_t ff = {' s','d ', 'f', 'g', 't'};
1
by: Mark Johnson | last post by:
I wonder if anyone has a solution? I wanted to use the web browser control as a 'zoom' box for a smaller textbox. I can format in the control, and save whatever formatting as HTML code back to the...
0
by: Mark Johnson | last post by:
The last reply got sort of cutoff. So here again: So for anyone interested, here's the simple regexp patterns for the substitutions required. The textbox control is being 'zoomed' in a popup...
4
by: possibilitybox | last post by:
I'm trying to make a unicode friendly regexp to grab sentences reasonably reliably for as many unicode languages as possible, focusing on european languages first, hence it'd be useful to be able...
0
by: Ben Wolfson | last post by:
I've got a db some of whose elements have been created automatically from filesystem data (whose encoding is iso-8859-1). If I try to select one of those elements using a standard SQL construct,...
1
by: deepusrp | last post by:
Helo, I have a text box, in which i want to display the unicode characters of a particular language; on pressing of a key event. How can i accomplish that. What i am doing is var...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.