Displaying page
of
pages;
Items to
Title |
Test
Details
Find standalone integers
|
Expression |
(?<!\.)(?<!e[+-])(\b\d+\b)(?!\.)
|
Description |
Locates standalone integers, like the 1 and 4 in 1/4, but doesn't match the 5 in 6e-5 (nor the 6, in fact). I use this to convert 1/4 to 1.0/4.0 so that it can be evaluated as a floating number, since 1/4 by itself will normally eval to 0 (integer division). However, 6e-5.0 would not be valid.
|
Matches |
1/4 | 1e-2+1/4 | 1.2+4/7
|
Non-Matches |
1.9e-2 | 1e+3 | 1e4
|
Author |
Rating:
Not yet rated.
Anders Blom
|
Displaying page
of
pages;
Items to