Tag Archive for 'regular-expressions'

08
Sep

Checking if a character is whitespace using the Flex StringUtil class’s isWhitespace() method

The following example shows how you can check whether a character is a whitespace character by using the isWhitespace() method in the mx.utils.StringUtil class. And just for giggles, I also show how you can do the same thing using regular expressions (RegExp) with POSIX character classes.

Full code after the jump.

Continue reading ‘Checking if a character is whitespace using the Flex StringUtil class’s isWhitespace() method’

22
Aug

Validating data using Regular Expressions

It looks like I forgot to post this and I’ve had this as a draft for a week. I was looking at creating a regular expression for validating a UPS tracking number and/or InfoNotice number and decided to do a quick RegExp for validating a Canadian postal code instead. Fear not, my 3 loyal readers, I’ll post the other regular expressions later on.

Full code after the jump.

Continue reading ‘Validating data using Regular Expressions’