If the match is successful (be sure to check), the numeric value will be in $1.
This matches one or more numeric digits, followed optionally by a decimal point and one or more digits, followed by an optional space, followed by "ms" (milliseconds). The space-"ms" part is not strictly necessary, but could help if there's a possibility of two sets of numbers ending up in the string somehow, plus IMHO, it can make an RE more human readable if there is some predictable anchor text in there for a human eye to catch.
Update: Note that this RE will accept numbers that look like "1", or "1.0", but not ".1". I did that on purpose, assuming that "0.1" is how decimal milliseconds would be represented. It wouldn't be too hard to tweak it to accept ".1" as well, but probably unnecessary. This particular RE will also reject numbers that have more than one decimal point (as in 198.60.22.2), which really isn't a number anyway. That too is by design. Oh, and negative numbers aren't accepted. Add an optional hyphen to the beginning if you want them. ;) Enjoy!
Dave
In reply to Re: How do I extract the value from this string...?
by davido
in thread How do I extract the value from this string...?
by evert
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |