You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2003/06/20 03:51:46 UTC

DO NOT REPLY [Bug 17799] - '/' not escaped in regexp mask

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17799>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17799

'/' not escaped in regexp mask





------- Additional Comments From adam@monkey.org  2003-06-20 01:51 -------
In GenericValidator.matchRegexp(), a substitution for any '/'s could be made 
with a '\\/'s. 
I think I'm overlooking something, but I tested passing in "foo/bar" as a 
value, and "foo/bar" as a regexp, and matchRegexp() returned true. I then 
checked "foo/bar" value and "foo/dad" regexp and got false return. Hmmm... so 
you don't need to escape all forward slashes (/)? the api javadoc I read about 
Perl5Util pointed to needing to escape forward slashes, so perhaps I've missed 
something.

I'll attach a patch that modifies the regexp string if it includes a forward 
slash. For example, regexp passed in: "foo/bar" would end up as "foo\/bar".
Not sure its really needed.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org