chambarish
asked on
Nearest match RegEx
I have this text
(Objectid < 100 OR ObjectID > 500) AND (apple OR 10a) W/5 Bill
I want to get nearest string with in() having And Or in it nearest W/digit.
I want to get only (apple OR 10a) and not (Objectid < 100 OR ObjectID > 500) AND (apple OR 10a)
I m using
But it brings back whole string instead of shortest.
(Objectid < 100 OR ObjectID > 500) AND (apple OR 10a) W/5 Bill
I want to get nearest string with in() having And Or in it nearest W/digit.
I want to get only (apple OR 10a) and not (Objectid < 100 OR ObjectID > 500) AND (apple OR 10a)
I m using
(?<DTVal>\(.*?(and|or|not).*?\))\s*(w|pre)/\d+\s*
But it brings back whole string instead of shortest.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
(test or best) W/5 AND (apple OR 10a) AND (Objectid < 100 OR ObjectID > 500) in the same reg EX.
In the above example I should get (test or best) (apple OR 10a)
Thanks for your help.