On 9/1/06, Meir Yanovich <[EMAIL PROTECTED]> wrote:
hello all im trying to capture only the first brackets but no matter what i do i keep capturing from the first brackets to the last one , here what i have : <% if (!Env.strLen(oidInvoice)); szDocumentTitle = Env.formatS("S",Env.getMsg("BP_INVOICE_ENUMERATION_CREATE_TITLE")) %> and the regexp i have is : <%\s*(if\s*\(.+?\))\s*%> i like to capture only : if (!Env.strLen(oidInvoiceEnum)) with no luck what im doing wrong?
The entire regex is important, not just the part being caprutred. Your regex asks for everything up to a ')' before zero or more spaces before '%>' You could try something like '<%\s+(if.+?\));' or '<%\s+(if.+?\)\)).+%>' The first way will be more effeciet, because it will stop as soon as you hit the ';' instead of going on until the final '%>'. HTH, -- jay -------------------------------------------------- This email and attachment(s): [ ] blogable; [ x ] ask first; [ ] private and confidential daggerquill [at] gmail [dot] com http://www.tuaw.com http://www.downloadsquad.com http://www.engatiki.org values of β will give rise to dom!