Re: [Flashcoders] regex issue when validating unicode range
thanks for the insight there Juan :) Chat Skype: mattmuller MSN: matt_b_mul...@hotmail.com Contact Me [image: Linkedin] http://www.linkedin.com/in/mattmuller[image: Facebook] http://www.facebook.com/matthewmuller[image: Twitter]http://twitter.com/mattmuller On Tue, Oct 20, 2009 at 3:57 AM, Juan Pablo Califano califa010.flashcod...@gmail.com wrote: Hi I don't think the regex is wrong. In fact, if you change u for a smaller number, it works fine. I have not tested each code point, mind you, but with a few tries, the highest max range that works that I could find is 0xFEFF. The range 0xFF00 - 0x apparently is reserved for control stuff. So 0xFEFF is the last value before that range. Not sure if the way the regex behaves is a bug or a feature, really, but you can probably get by with something like this: var testIsArabic:Boolean = /[\u0627-\ufeff]/.test(str.charAt(0)); Cheers Juan Pablo Califano 2009/10/19 Matt Muller matthewmul...@gmail.com Hi there, issue with regex when trying to test if a char is within a unicode range var testIsArabic:Boolean = /\u0627/.test(str.charAt(0)); // this works testing for arabic chars of unicode 0627 var testIsArabic:Boolean = /[\u0627-\u]/.test(str.charAt(0)); this range does not work, returns false NOTE: the str.charAt(0) is 0627 any ideas? cheers, MaTT ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] regex issue when validating unicode range
Hi there, issue with regex when trying to test if a char is within a unicode range var testIsArabic:Boolean = /\u0627/.test(str.charAt(0)); // this works testing for arabic chars of unicode 0627 var testIsArabic:Boolean = /[\u0627-\u]/.test(str.charAt(0)); this range does not work, returns false NOTE: the str.charAt(0) is 0627 any ideas? cheers, MaTT ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] regex issue when validating unicode range
Have you tried looking at Grant Skinner's RegExp App? It might help http://gskinner.com/RegExr/ Ktu On Mon, Oct 19, 2009 at 1:24 PM, Matt Muller matthewmul...@gmail.comwrote: Hi there, issue with regex when trying to test if a char is within a unicode range var testIsArabic:Boolean = /\u0627/.test(str.charAt(0)); // this works testing for arabic chars of unicode 0627 var testIsArabic:Boolean = /[\u0627-\u]/.test(str.charAt(0)); this range does not work, returns false NOTE: the str.charAt(0) is 0627 any ideas? cheers, MaTT ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] regex issue when validating unicode range
Hi I don't think the regex is wrong. In fact, if you change u for a smaller number, it works fine. I have not tested each code point, mind you, but with a few tries, the highest max range that works that I could find is 0xFEFF. The range 0xFF00 - 0x apparently is reserved for control stuff. So 0xFEFF is the last value before that range. Not sure if the way the regex behaves is a bug or a feature, really, but you can probably get by with something like this: var testIsArabic:Boolean = /[\u0627-\ufeff]/.test(str.charAt(0)); Cheers Juan Pablo Califano 2009/10/19 Matt Muller matthewmul...@gmail.com Hi there, issue with regex when trying to test if a char is within a unicode range var testIsArabic:Boolean = /\u0627/.test(str.charAt(0)); // this works testing for arabic chars of unicode 0627 var testIsArabic:Boolean = /[\u0627-\u]/.test(str.charAt(0)); this range does not work, returns false NOTE: the str.charAt(0) is 0627 any ideas? cheers, MaTT ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders