Regular Expressions to NOT match a pattern

Negative lookarounds are usually what you're after:

Negative Lookbehind

  • (?<!status )code

    matches code not preceded by status

  • (?<!status )(?<!post)code

    matches code not preceded by status or by post

Negative Lookahead

  • code(?!smith)

    matches code not followed by smith

  • code(?!smith)(?!d)

    matches code not followed by smith or by d

Negated Character Classes

But to not-match just a single character you can do it with character a class:

  • code[^d]

    matches code but not coded

  • code=[^0-9]

    matches code=X where X is not a digit

Learn more...

Outlook 2011 Mac hangs with IMAP – Folder Sync

Ignoring all the other problems with using Outlook 2011, one problem I had and solved:
Having set it to use IMAP, I then set the Preferences - Accounts - Advanced - Sync IMAP folders every xxx minutes to OFF.
Which stopped it hanging every 5 minutes.