Tuesday, April 9, 2013

parsing "^[a-ZA-Z]+$" - [x-y] range in reverse order.

Once I was trying to do a simple regex validation for alpha string and i got the strange error :


parsing "^[a-ZA-Z]+$" - [x-y] range in reverse order.


The reason was that in the first range, i wrote a-Z instead of a-z. 

So the string which should have been "^[a-zA-Z]+$" was actually written as 
                                                            "^[a-ZA-Z]+$".

Notice that Z is written in caps in both places. 

I corrected the error and it compiled properly.

No comments:

Post a Comment