Regular Expressions
| “ | Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems. | ” |
| —Jamie Zawinski | ||
Contents |
Overview
Regular Expressions are awesome but it's usually one of those things where you need to reference a manual when you're working with them because you need to make sure what you're doing is working right. This will have reference to RegEx Guides as well as have some common patters that seem to work out well for me.
Online References
Expressions
- Number with two decimals
^([1-9]\d{0,2}(\,\d{3})*|([1-9]\d*))(\.\d{2})- Will match 125.32 or 125,325.53
- E-Mail address:
^([0-9a-zA-Z]([-\.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$