From: David W. <wo...@cs...> - 2008-02-29 20:52:37
|
At the moment, the Pattern class defaults to using the regular expression ``^(.*)<user patter>(.*)$`` to match everything. This becomes problematic, however, if the user's pattern has an optional prefix (ie: ``(\!?stuff)`` -- the ! (if it exists) will be matched as part of the (.*) instead of the (\!?stuff)). I've replaced the regular expression with ``^(.*?)%s(.*?)$`` -- the non-greedy sides should do the trick (at least in my situation). Now, is there any reason this shouldn't be used generally? I can't think of any expression which it would break... But, admittedly, my regex-foo is low. Thanks, David |