Autocat advanced rules (contains this when not that)

I’m looking to create a rule where the description contains the word ‘credit’ and does not contain the words ‘stripe’ or ‘zelle’.
I have autocat rules for when there is a credit with either of those words, and then everything else, I want caught in another category and tagged differently…
Any thoughts?
Thank you!

Hi @stephanie1:

Here’s one way to do it, using Regex.

  1. On your AutoCat Sheet, add a new column (if you don’t already have it) and as a column header enter the words, Description Regex.

  2. On the row for your rule, in the column called Description Regex, enter this:

credit(?!( stripe| zelle))

…and then add the values you want to substitute in the Tag and Category columns of that row for the transactions that meet these criteria.

  1. Be sure the transactions you wish to edit are not categorized and Run AutoCat.

The rule works like this: A(?!( B| C)) and means, "Find every A where there is no B or C following.

(Note, there is a space before the B or C in the formula, in the event this is a standard part of the string pattern you’re seeking. So, in your formula above, it is actually (space)stripe and (space)zelle. If this is not in your pattern, leave it out.)

I tested it on my sheet and it appears to work.

(Here’s some fun documentation for those interested.)


Thanks @Brad.warren !!

1 Like


Thank you for your posts on Regex. They’re very helpful.

Saluda, NC

1 Like