Thursday, February 17, 2011

Regex reference

1.Range between 0 and 1: [0]\.[0-9]+|[1]
Matches: 0, 1, 0.50, 0.999999
Non-matches: 1.1

2. Money without dollar sign:  ^\d+.\d{1,2}
Matches: 0.30, 9.45, 100.50
Non-matches: .45, 0.451, 9.512, 9.5

Will add more as the need arises.

Great site for testing regular expressions:
http://regexpal.com/

No comments:

Post a Comment

There was an error in this gadget