Regular Expressions to NOT match a pattern

Negative lookarounds are usually what you're after:

Negative Lookbehind

  • [code](?<!status )code[/code] matches code not preceded by status
  • [code](?<!status )(?<!post)code[/code] matches code not preceded by status or by post

Negative Lookahead

  • [code]code(?!smith)[/code] matches code not followed by smith
  • [code]code(?!smith)(?!d)[/code] 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]code[^d][/code] matches code but not coded
  • [code]code=[^0-9][/code] 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.