Link to home
Start Free TrialLog in
Avatar of sidwelle
sidwelleFlag for United States of America

asked on

regx exclude pattern

I need to have a 1 line expression that excludes patterns that include a specific pattern or substring.

Not sure where to start:
I have the following pattern  "*.Done", and I want an expression that excepts all patterns except this one.

Thanks
Avatar of sidwelle
sidwelle
Flag of United States of America image

ASKER

((?!\.done))$        //this expression produces an error "Infinite loop"
Avatar of Brian Benson
Brian Benson

This works for me... but negative operators can vary by regex interpreter
/^((?!\*\.Done)[\s\S])*$/gm

Open in new window

Thanks for responding, I had already found as working answer:   ^((?!\.done).)*$

You solution didn't work testing Here
don't know why ?
ASKER CERTIFIED SOLUTION
Avatar of Brian Benson
Brian Benson

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I added the 'i' to be case insensitive.

Thanks for answering