Closed dhollinden closed 6 years ago
The minus is escaped because it has a special meaning in character sets—[a-z]
matches any character from 'a' to 'z'. In this case, since there is no character after the minus, it would also work without escaping, but it's a good idea to always escape minus characters inside of sets.
In the hint for ch. 9 exercise 3, the hint states:
"Matching the optional sign in front of the number, as well as in front of the exponent, can be done with [+-]? or (+|-|) (plus, minus, or nothing)."
It seems to me that "[+-]?" should be "[+-]?"
Hope I'm not incorrect. Thanks.