Page 1 of 1

Reg expression for all except path containing "iconic"

Posted: Tue Aug 23, 2011 3:53 pm
by Brian
Hello,

I need to select files in two steps: 1) using Select by Location, preserve the files in a certain folder and all subfolders. This works fine. 2) Then to further refine, I need to unselect those that do NOT have the word iconic in their path. I chose Select by text pattern, change the Column Name to Path, select the 'Use Regular Expressions' checkbox, put (?!iconic) as the Pattern to match and click Unmark. The result is that all selections are removed. What am I doing wrong?

Thanks,
Brian

Re: Reg expression for all except path containing "iconic"

Posted: Tue Aug 23, 2011 8:05 pm
by DV
That regex selects everything - I think just "iconic" then unmark should work to unmark everything that contains that phrase.

Re: Reg expression for all except path containing "iconic"

Posted: Tue Aug 23, 2011 8:43 pm
by Brian
I need the opposite, unmark those that do NOT contain the phrase.

Re: Reg expression for all except path containing "iconic"

Posted: Tue Aug 23, 2011 9:09 pm
by DV
How about:

Code: Select all

^(?!.*iconic)

Re: Reg expression for all except path containing "iconic"

Posted: Tue Aug 23, 2011 9:18 pm
by Brian
That worked! Thanks DV.

Re: Reg expression for all except path containing "iconic"

Posted: Tue Aug 23, 2011 10:50 pm
by Brian
DV, sorry to trouble you again but could you give the expression that would unmark those that do NOT contain the word iconic EXCEPT for those that contain the word cfa (meaning leave their marked state alone).

Re: Reg expression for all except path containing "iconic"

Posted: Wed Aug 24, 2011 8:35 pm
by DV
That's a tricky one- haven't worked it out yet!