Regex Matcher bug on "-"
APSL's regex seems to have a bug. APSL uses Text.Regex.TDFA from the regex-tdfa package. The module claims to implement POSIX extended regular expressions.
Do this in ghci:
import Text.Regex.TDFA ("a-a" =~ "^[\-a]*$") :: Bool False
This should be true. However:
("a-a" =~ "^[-a]*$") :: Bool True
The problem is the "-" that in POSIX extended '-' is a special character. To have that as a literal we have to write "\-". So the above seems buggy.
This affect the Websocket casestudy, which contains:
type UriPath is Text(pattern=/\/[a-zA-Z0-9\-\._~\/]*/)
Work around: do not allow "-" in the cases study :(