Regular Expressions

A regular expression (regex or regexp for short) is a special text string for describing a search pattern. You can think of regular expressions as wildcards on steroids. You are probably familiar with wildcard notations such as *.txt to find all text files in a file manager. The regex equivalent is .*\.txt. Regular expressions were not invented by Just Great Software. They're a common technology useful in a variety of situations.

AceText search-and-replace functions provide full support for regular expressions. Instead of searching for fixed search terms, you can search for text fitting a certain pattern, without specifying an exhaustive list or even knowing in advance exactly what you want to find. E.g. you could use the regular expression \b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b to search for an email address. Any email address, to be exact.

Regular expressions also allow you to automate tedious editing tasks with a quick search-and-replace. E.g. to turn all URLs into HTML anchor tags, search for http://\S+ and replace with <a href="\0">\0</a>.

AceText uses the same regular expression engine as PowerGREP and EditPad Pro. It's a custom engine that blends the best features of the Perl, Java, and .NET regular expression flavors. AceText's regex flavor is fully supported by RegexBuddy and RegexMagic, two tools that make it easy to create regular expressions.

You can invoke RegexBuddy by pressing Ctrl+Shift+R in AceText or by clicking the Search Options button in the bottom right corner in AceText and then selecting RegexBuddy in the menu. RegexBuddy makes it easy to prepare regular expressions for use with AceText and a variety of other applications and programming languages. RegexBuddy can also analyze existing regular expressions and convert regular expressions from the hundreds of regex flavors that it supports to AceText's flavor, and vice versa.

You can invoke RegexMagic by clicking the Search Options button in the bottom right corner in AceText and then selecting RegexMagic in the menu. RegexMagic allows you to create regular expressions by using high-level RegexMagic patterns to describe the text that you want to match. RegexMagic then generates the regular expression for you. With RegexMagic, you don't need to deal with the terse and cryptic regex syntax at all.

You can read an excellent tutorial to regular expressions at