tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <funk...@apache.org>
Subject Re: Tomcat 7 & regex
Date Sat, 25 Dec 2010 20:34:11 GMT
I am thinking from an admin point of view. While you can combine OR 
conditionals in regex's - when you get something more complicated - you 
may encounter a nasty nesting of () to get all the nested OR's correct. 
So while one COULD to it in a single regex - most mere mortals might not 
be able to comprehend that regex. This is where combining different 
regexes by a user defined split may come in handy.

But in reality ... the general case a user is doing is probably a 
singular regex. So since the capability exists for more exotic matches, 
it may be easier to simplify the code per your (mark's) suggestion and 
then provide enough coaching to demonstrate how more advanced regexes 
can be applied.

(So I am cool with it. Time permitting - I'll try to provide an example 
or 2 for odd regexes - like RFC1918 matching for the RemoteAddrressFilter)

-Tim

On 12/25/2010 2:53 PM, Mark Thomas wrote:
> On 25/12/2010 01:49, Tim Funk wrote:
>> +0.5 - I wonder if in some cases - it may be preferable to use a
>> property called split which lets the user define the separator which we
>> can pass to String.split(). [Which OTOH may be more confusing (yet
>> powerful) since the user is using a regex to split get a list of regex]
>
> I think that just makes it more complicated. There is no need to split
> anything up since the regex can just use |. Rather than mix regex plus
> our own proprietary splitting mechanism, I think we should just use the
> support already provided by regex to do the same thing.
>
> Mark


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


Mime
View raw message