regex: force entire string to match

bearophile bearophileHUGS at lycos.com
Tue Jan 31 09:57:51 PST 2012


NewName:

> Hello all.
> I want to write a regex to check if a whole string is a number.

Also:

import std.stdio, std.string, std.array;
void main() {
    string s = "123";
    assert(s.removechars("0-9").empty);
}

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list