Rev | Line | |
---|
[976] | 1 | ###
|
---|
| 2 | ### Common Regular Expressions
|
---|
| 3 | ###
|
---|
| 4 | import re
|
---|
| 5 |
|
---|
| 6 | ##
|
---|
| 7 | ## Match a decimal integer
|
---|
| 8 | ##
|
---|
| 9 | re_integer = re.compile('^\d+$')
|
---|
| 10 |
|
---|
| 11 | ##
|
---|
| 12 | ## Match a floating point value
|
---|
| 13 | ##
|
---|
| 14 | re_float = re.compile('^\d+\.\d+$')
|
---|
| 15 |
|
---|
| 16 | ##
|
---|
| 17 | ## Scientific E Notation
|
---|
| 18 | ##
|
---|
| 19 | ## +4.57087000000000E+002
|
---|
| 20 | ##
|
---|
| 21 | re_enotation = re.compile('^([+-])?(\d+)\.(\d+)[eE]([+-])(\d+)$')
|
---|
| 22 |
|
---|
| 23 | ##
|
---|
| 24 | ## SQL DATETIME
|
---|
| 25 | ##
|
---|
| 26 | re_sql_datetime = re.compile('^(\d\d\d\d)-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)\.?(\d*)$')
|
---|
Note:
See
TracBrowser
for help on using the repository browser.