On Thu, Jun 08, 2006 at 07:56:13AM -0700, brian pink wrote: > > On Thu, Jun 08, 2006 at 07:25:15AM -0700, brian pink wrote: > > > > Is there a way to use grep to find the first match instead of the > last > > > > match? For example, if I use > > > > ... > > > > > > <!-- begin header -->(?s:.*?)<!-- end header --> > > > > > > doesn't feel right to me, but it works as intended. =) > > > > It feels right to me - I would have suggested it if you hadn't. :) > > I would have thought to write .? instead of .*? in a Perl script, but > that didn't work. That's what didn't feel right...
.? matches 0 or 1 characters. .* and .*? both match 0 or more characters, but .* is greedy while .*? is non-greedy. It's the same syntax as Perl, because BBEdit uses Perl Compatible Regular Expressions. Ronald -- ------------------------------------------------------------------ Have a feature request? Not sure the software's working correctly? If so, please send mail to <[EMAIL PROTECTED]>, not to the list. List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml> List archives: <http://www.listsearch.com/BBEditTalk.lasso> To unsubscribe, send mail to: <[EMAIL PROTECTED]>
