|Welcome to the Monastery|
Re: simple perl regex question (or is it?)by LanX (Canon)
|on Nov 11, 2013 at 00:02 UTC||Need Help??|
I think you need to anchor the end not the start of your match.
something like /(.*?)(AND|OR|$)/g
if you really need the preceding AND|OR do a positive look ahead
sorry can't test ATM.
(Hopefully you don't expect this to work with nested ANDs and ORs within the parens?)
looks good for me HTH
if you can deal with leading empty strings try split
( addicted to the Perl Programming Language)