Re: [xml-dev] Internationalising Regular Expressions

John,

Thanks for the replies. It strikes me that I could have phrased some of my 
questions more precisely. In one case it, I think, led you to give an 
incorrect response, at least when viewed from a pedantic vantage point.

A suggested issue for W3C TAG follows at the end of this email.

In a message dated 30/10/2002 12:00:01 GMT Standard Time, 
jcowan@reutershealth.com writes:


> > In W3C XML Schema, and therefore in XForms, is it correct that the only 
> way 
> > to express the notion of an English language / ASCII "word character" in 
> a 
> > regular expression is using [A-Za-z0-9_]? 
> 
> Correct.

I didn't express my question well. The character class I gave isn't the 
"only" solution. Equivalent character classes such as [0-9a-zA-Z_] would also 
work. I take your answer to assent to the notion that a character class which 
enumerates allowed characters is the only approach in W3C XML Schema and 
therefore XForms.


> 
> > Is there any facility to express the notion of, for example, a French 
> word 
> > character? Or German?
> 
> You'd have to concoct a similar character class, and there is always
> a measure of controversy about these things.  The standard English 
> spellings of
> "naïve" and "façade" require letters outside [A-Za-z], and so does
> one spelling of "coöperate".

I assumed that might be necessary. :(

> 
> > Or is the \p{Basic_Latin} the smallest / most precise 
> > "chunk" of characters that can be used in such a setting?
> 
> That certainly doesn't do what you want: it matches any ASCII character,
> rejecting the non-ASCII ones.
> 

I expressed my question poorly. What I think I was trying to ask was "Is a 
defined/named sequence of consecutive Unicode character points the only way 
to attempt to approach this?". Or alternatively, "There is no officially / 
widely accepted character class for, say, French word characters?".

BTW does anyone know what metacharacters are used in, say, French JavaScript 
code? Is it already the case, practically speaking, that \w wouldn't be used 
in any way by non-English speakers and that an appropriate character class 
would be the only solution?

It seems to me that W3C XML Schema effectively makes a radical change to the 
usage of the \w metacharacter. Implementations of regular expressions already 
have more than enough inconsistencies. 

Isn't it long overdue that some more consistent cross-language regular 
expression syntax was developed?

A tasty issue for the TAG? Or IETF?

Pass the aspirin someone, I feel a headache coming on! :)

Andrew Watt

Received on Wednesday, 30 October 2002 07:41:12 UTC