Regular Expressions: Difference between revisions
No edit summary |
No edit summary |
||
Line 14: | Line 14: | ||
With matching scientific notation (e.g. 1.5e-6). | With matching scientific notation (e.g. 1.5e-6). | ||
[https://rgxdb.com/r/1RSPF8MG Reference] | [https://rgxdb.com/r/1RSPF8MG Reference] | ||
<syntaxhighlight lang | <syntaxhighlight lang="ragel"> | ||
([-+]?\d*\.?\d+)(?:[eE]([-+]?\d+))? | ([-+]?\d*\.?\d+)(?:[eE]([-+]?\d+))? | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 12:07, 23 September 2019
Regular expressions are used for matching text.
Useful Regular Expressions
Mostly copied from Regex DB.
Floating Point Number
Without matching scientific notation (e.g. 1.5e-6). Reference
[-+]?[0-9]*\.?[0-9]+
With matching scientific notation (e.g. 1.5e-6). Reference
([-+]?\d*\.?\d+)(?:[eE]([-+]?\d+))?