Re: limiting resource in regex matching

2002-11-30 Thread David Garamond
david wrote: The Perl book (I think it's the Programming Perl) has an example where a certain reg. exp and string combination can make Perl's reg. engine run forever (in terms of years!) because of backtracking. The solution the book generally recommand is to use one of the newer reg. exp exten

Re: limiting resource in regex matching

2002-11-30 Thread david
David Garamond wrote: > i'm creating a web interface for users to add their own mail filtering > rules. the rules allow them to specify regexes to match headers and mail > body. however, i'm a little concerned with how users can accidentally/ > intentionally use too complex regexes like this "(a+.

Re: limiting resource in regex matching

2002-11-28 Thread simran
very interesting question... i can't wait to hear a solution myself if anyone out there knows of one... you might want to put the regex inside an "alarm/eval" block anyway so that at least you can limit the maximum time it takes... simran. On Fri, 2002-11-29 at 13:48, David Garamond wrote: >

limiting resource in regex matching

2002-11-28 Thread David Garamond
i'm creating a web interface for users to add their own mail filtering rules. the rules allow them to specify regexes to match headers and mail body. however, i'm a little concerned with how users can accidentally/ intentionally use too complex regexes like this "(a+.*(b+.+(c*.+)*.*))*" and the