I want to strip all characters except decimal digits from a string.
Combining "uhelp @xreplace" with TCC help topic
"regularexpressionsyntax.htm" this should do it:
echo %@xreplace[\D,,string]
However, this command:
echo %a %+ echo %@xreplace[\D,,%a]
reports:
2009-07-18,21:19:20.000
212009-07-18192009-07-18202009-07-18000
Note: my regular expression syntax is set to "perl".
BTW, the real purpose is to report a compact but intelligible file
timestamp. An additional date format in Charles Dye's iso8601.dll would do
the trick much more neatly. @DATECONV ought to have explicit format
specification for both input and output format, esp. to disambiguate input
dates like 12/05/10 - it could be German style (May 12th) or US style (Dec.
5th).
--
Steve
Combining "uhelp @xreplace" with TCC help topic
"regularexpressionsyntax.htm" this should do it:
echo %@xreplace[\D,,string]
However, this command:
echo %a %+ echo %@xreplace[\D,,%a]
reports:
2009-07-18,21:19:20.000
212009-07-18192009-07-18202009-07-18000
Note: my regular expression syntax is set to "perl".
BTW, the real purpose is to report a compact but intelligible file
timestamp. An additional date format in Charles Dye's iso8601.dll would do
the trick much more neatly. @DATECONV ought to have explicit format
specification for both input and output format, esp. to disambiguate input
dates like 12/05/10 - it could be German style (May 12th) or US style (Dec.
5th).
--
Steve