Regular Expressions: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 16: Line 16:
Capturing significand and exponent separately.
Capturing significand and exponent separately.
<syntaxhighlight lang="ragel">
<syntaxhighlight lang="ragel">
([-+]?\d*\.?\d+)(?:[eE]([-+]?\d+))
([-+]?\d*\.?\d+)(?:[eE]([-+]?\d+))?
</syntaxhighlight>
</syntaxhighlight>
Capturing the entire string together.
Capturing the entire string together.
<syntaxhighlight lang="ragel">
<syntaxhighlight lang="ragel">
([-+]?\d*\.?\d+[eE][-+]?\d+)
([-+]?\d*\.?\d+(?:[eE][-+]?\d+)?)
</syntaxhighlight>
</syntaxhighlight>