Company
Date Published
Author
Sebastian Hungerecker
Word count
1157
Language
English
Hacker News points
None

Summary

^1[3|4|5|7|8][0-9]{9}$` is a mobile phone number matcher that incorrectly uses the character class `[3|4|5|7|8]`, which should be replaced with `[34578]`. The `[^/^ ^;^,]` code has an incorrect use of the negation symbol `^` before each element. In another example, the Apache Camel code `...[\\.|a-z|A-z|0-9]...` incorrectly uses uppercase and lowercase characters in a character range, causing it to match more than intended. A similar bug is found in Elasticsearch's `Pattern.compile("[a-zA-z0-9!#$%&'*+\\-.\\^_`|~]+");`, where the hyphen `-` loses its special meaning inside the character class, allowing it to match a literal `-` instead of a range of characters. In Jenkins' `USERINFO_CHARS_REGEX = "[a-zA-Z0-9%-._~!$&'()*+,;=]"`, the range `%-.;` does not correctly represent the intended set of characters, causing it to only match the character `-`. Additionally, the variable name `safetextRegex` contains an incorrect character class that matches more than intended. The Apache Hadoop code `Pattern.compile("acl[0-31]")` is supposed to match a specific range of acl numbers but incorrectly uses a single digit instead of two. Finally, the Apache Geode code `...[aA-zZ0-9-_.]...` contains an incorrect character class that matches more than intended due to the use of uppercase and lowercase characters in a single range. The Alibaba's Tangram source code incorrectly uses alternation operators outside of a character class, causing it to lose its meaning as quantifiers.