Using lazy evaluation on a large regular expression (and not just .*?)

borokcoy

New Member
Using the follow regex:\[code\]\[\w* \w* \d{2} [\w:]* \d{4}\] \[error\] \[client .*?\] .*? Using HTTP not .*?<br /> \[/code\]I get the following results (where yellow boxes indicate a match):
zbvhG.png
Raw Text: http://pastebin.com/vSi0mLGv The bottom two sections are correct. I want all sections that contain: \[code\]<<<NOTICE>>> Non-Prod Server: Using HTTP not HTTP/S\[/code\]The top section however, contains the correct string (similar to the bottom two), but also comes with a whole other chunk that I do not want:\[code\][Thu May 10 17:43:48 2012] [error] [client ::1] Current Name:DashboardBar_projAnnualReview200, referer: http://localhost/test/pages/TestPage.php<br />`\[/code\]I know this comes down to regex being greedy, but how can I go about making it do a lazy evaluation for the \[code\]<br />\[/code\], if that's even the right way to go about it. I've tried \[code\](<br />)*?\[/code\] and others to no avail.Other Information:I am using Sublime Text 2, and performing a regex search if anyone wanted to recreate the image.
 
Back
Top