Use regular expressions in CotEditor on Mac

In CotEditor, you can use regular expression patterns in features such as Find and Replace and pattern-based line sorting to define flexible matching conditions. Regular expressions are also used to specify rules for syntax highlighting and outline extraction.

Regular expressions are a notation for describing specific text patterns when searching for or replacing text. They are used in many programming languages and tools, and allow flexible text processing. For example, the regular expression pattern “dog|cow” matches either “dog” or “cow”.

There are several implementations of regular expressions. While the basic syntax is similar, the supported features and detailed behavior can vary between implementations. CotEditor uses an ICU-compatible regular-expression engine. For details about the regular expression syntax, see the ICU Regular Expressions Guide.

You can also customize detailed behaviors when performing regular expression searches and replacements. For more information about customization options, see Find and replace text.

See also