Regular Expressions: Difference between revisions

no edit summary
(Created page with "Regular expressions are used for matching text. ==Useful Regular Expressions== ===Floating Point Number=== [https://www.regular-expressions.info/floatingpoint.html Referenc...")
 
No edit summary
Line 4: Line 4:


==Useful Regular Expressions==
==Useful Regular Expressions==
Mostly copied from [https://rgxdb.com/ Regex DB].
===Floating Point Number===
===Floating Point Number===
Without matching scientific notation (e.g. 1.5e-6).
[https://www.regular-expressions.info/floatingpoint.html Reference]
[https://www.regular-expressions.info/floatingpoint.html Reference]
<syntaxhighlight lang="ragel">
<syntaxhighlight lang="ragel">
[-+]?[0-9]*\.?[0-9]+
[-+]?[0-9]*\.?[0-9]+
</syntaxhighlight>
With matching scientific notation (e.g. 1.5e-6).
[https://rgxdb.com/r/1RSPF8MG Reference]
<syntaxhighlight lang+"ragel">
([-+]?\d*\.?\d+)(?:[eE]([-+]?\d+))?
</syntaxhighlight>
</syntaxhighlight>