On Fri, Aug 22, 2008 at 4:50 PM, justin <[EMAIL PROTECTED]> wrote: > try this: > > ^(?!.*/-/.*/-/)((.+?)/-/(.*)|(.*))$ > > matches: > > 0 - the full line (if it meets the requirements) > 1 - everything before the /-/, if /-/ exists. > 2 - everything after the /-/, if /-/ exists and if there is anything after it. >
sorry, i gave you the wrong version. should have been this: ^(?!.*/-/.*/-/)((.+?)/-/(.*)|.*)$ the last set of parentheses were unnecessary, since match 3 == match 0 any time match 3 != ''. i'm also assuming you don't actually need a match for the /-/ string. if you do, go ahead and wrap that in parentheses. justin -- http://justinhileman.com _______________________________________________ UPHPU mailing list [email protected] http://uphpu.org/mailman/listinfo/uphpu IRC: #uphpu on irc.freenode.net
