0
votes

Im encountering a strange issue using esapi validation.

Bellow is my regex that is working for me as expected except when I include the string "&sub" it does not find a match.

^[0-9a-zA-Z :;=@$?()+&\\[\\]\\/\\\\#.,\\-'_]{0,1000}$

Any other combination like "&su" or "&bus" is fine, when I add "&sub anywhere in the string it throws an error.

Invalid input. Please conform to regex ^[0-9a-zA-Z :;=@$?()+\&\[\]\/\\#.,\-'_]{0,1000}$ with a maximum length of 1000

Any help appreciated

1
The error part sounds strange; if the regex doesn't match, then it should just fail and your code continues. Can you show us your actual Java code? - Tim Biegeleisen
by any chance do you have the " infront of the &sub as given in the question? - Matt.G

1 Answers

0
votes

Found the issue, it doesn't like HTML special characters, others like &nbsp reproduce. Thanks