Support

Regular expression syntax and the Find dialog

OmniFocus’s Find dialog supports the use of some simple regular expressions. A regular expression is a single string that represents a set of possible strings. To get started, use Command-F to open the Find dialog, and change the Find Type setting to Regular Expression.

The Find Dialog

Supported syntax is as follows:

  • a* – zero or more instances of a (matches the longest string possible)
  • a*? – zero or more instances of a (matches the shortest string possible)
  • a+ – one or more instances of a (matches the longest string possible)
  • a+? – one or more instances of a (matches the shortest string possible)
  • a? – zero or one instance of a
  • ^ – beginning of a line
  • $ – end of a line
  • . – any character
  • [a-z] – all characters between a and z
  • [abc-] – a, b, c, or -
  • 91 (abc) – matches abc and stores it as a group. Use the Select or Replace pop-up menu in the Find dialog to select or replace only one of these groups rather than the whole expression.
  • \1 – text of first matched group
  • a|b – a or b
  • \n – newline
  • \r – carriage return
  • \t – tab character
  • \d – digit
  • \D – non-digit
  • \w – word character (alphanumeric or underscore) \W — non-word character
  • \s – whitespace
  • \S – non-whitespace
  • \ – escape the next character

Regular expressions are popular, so you should be able to find plenty of information about them on the internet or in a good library or bookstore. Here are a few examples to get you started:

  • \s*$ – matches whitespace at the end of a line.
  • \S+@\S+ – liberally matches things that resemble e-mail addresses (anything@anything).
  • (19|20)\d\d-\d\d?-\d\d? – matches dates in the format YYYY-MM-DD, between 1900 and 2099
Last Modified: Oct 2, 2017

Can we help?

support@omnigroup.com
+1 206-523-4152 or 800-315-OMNI

Was this article helpful?

Still need help?

support@omnigroup.com
+1 206-523-4152 or 800-315-OMNI