At 16.25 +0100 98-03-10, Steven Pemberton wrote: > > What about: > > > > ^ *(fr|FR)(-[A-Za-z]+)* *$ > ><P lang="Fr-not">Wrong!.</P> > >This might do it better: > > ^[fF][rR][-A-Za-z]* I wasn't trying to match "fR" or "Fr". Your regexp would match those two, but also "free" or "franc-centime" and even "From A to Z" (Since you omitted the end-of-string "$", the regexp kan match only the beginning of the string, so that any string starting with FR, fr, Fr or fR will match. With the trailing "$", it will still match any string starting with FR, fr, Fr or fR, if the string consists only of letters and hyphens - like "free" or "franc-centime".). A regexp that matches language codes of mixed case would be something like: ^ *[fF][rR](-[A-Za-z]+)* *$ Note that I, as Bert did, permits spaces in the beginning and end of the string. Hence the " *". Best regards, Carl Johan Berglund ___Carl_Johan_Berglund_________________________ Adverb Information carl.johan.berglund@adverb.se http://www.adverb.se/Received on Tuesday, 10 March 1998 10:59:24 GMT
This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:53:54 GMT