I've been working with someone else's code and I ran across the regular expression [^0-9a-z-A-Z]
. This bears close resemblance to the common [^0-9a-zA-Z]
which is meant to exclude non-alphanumeric characters, but note the extra dash in the middle, between the lowercase z
and uppercase A
.
I'm not very familiar with regular expressions, but I've read several pages on them now, and none of the rules I've seen seem to cover what this syntax would mean. Perhaps it's not even valid syntax, but the Golang regex interpreter doesn't seem to mind. I'd appreciate any clarification. Thanks.