- Dec
- 238
- 2
In Perl:
The regex specifies start of input, single '.', single digit, then end of input. That pattern clearly doesn't match "$amount" and such a comparison of course returns FALSE.
Now in TCC:
... and TRUE is echoed. It's telling me I have a match even though the regular expression doesn't have the metacharacter for a digit at the start of input (preceding the '.').
This is the first version of the command processor I've used that supports the regex comparison operator, and I'm sure I must be missing something simple and obvious. So...what am I missing? I would not have expected this to produce a match.
TCC 15.01.52 x64 Windows 7 [Version 6.1.7601]
$amount = 1.5; # and now let's try:
$amount =~ /^\.\d$/
$amount =~ /^\.\d$/
The regex specifies start of input, single '.', single digit, then end of input. That pattern clearly doesn't match "$amount" and such a comparison of course returns FALSE.
Now in TCC:
set amount=1.5
if %amount =~ ^\.\d$ echo TRUE
if %amount =~ ^\.\d$ echo TRUE
... and TRUE is echoed. It's telling me I have a match even though the regular expression doesn't have the metacharacter for a digit at the start of input (preceding the '.').
This is the first version of the command processor I've used that supports the regex comparison operator, and I'm sure I must be missing something simple and obvious. So...what am I missing? I would not have expected this to produce a match.
TCC 15.01.52 x64 Windows 7 [Version 6.1.7601]