Example on dlang.org // Round floating point numbers
Martin Tschierschke via Digitalmars-d
digitalmars-d at puremagic.com
Thu Jun 16 04:55:26 PDT 2016
The example
// Round floating point numbers
with the floating point substitution using the Regex:
reFloatingPoint = ctRegex!`[0-9]+\.[0-9]+`;
Is not so nice, because it would match for dates like 16.06.2016,
too.
(I remember having a simmilar problem when trying to substitute
123.44 Euro to
German format: 123,44 Euro ending up with a modified date:
16,06.2016)
Sure this may be not the point of the example, but I dislike it
therefore.
How to expand the Regex not to match dates?
Regards
martin
More information about the Digitalmars-d
mailing list