Regular Expressions: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 13: Line 13:


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]<br>
Capturing significand and exponent separately.
<syntaxhighlight lang="ragel">
<syntaxhighlight lang="ragel">
([-+]?\d*\.?\d+)(?:[eE]([-+]?\d+))?
([-+]?\d*\.?\d+)(?:[eE]([-+]?\d+))
</syntaxhighlight>
Capturing the entire string together.
<syntaxhighlight lang="ragel">
([-+]?\d*\.?\d+[eE][-+]?\d+)
</syntaxhighlight>
</syntaxhighlight>