Knowledge Base/New Digital Tiger/Other helpful tools

Sharpen your search with Regex

Nicholas Karonji
posted this on June 30, 2011 06:52 pm

Digital Tiger allows you to use Google's Regex Engine to perform complex search functions and increase the flexibility of your search. Although Regular Expressions may be out of range for the needs of most users, understanding how they work and how they can help you can be important when trying to perform custom searches.

In computing, a Regular Expression, also referred to as regex or regexp, provides a concise and flexible means for matching strings of text, such as particular characters, words, or patterns of characters. A Regular Expression is written in a formal language that can be interpreted by a regular expression processor.

Examples of Regular Expressions

  • .at matches any three-character string ending with "at", including "hat", "cat", and "bat".
  • [hc]at matches "hat" and "cat".
  • [^b]at matches all strings matched by .at except "bat".
  • ^[hc]at matches "hat" and "cat", but only at the beginning of the string or line.
  • [hc]at$ matches "hat" and "cat", but only at the end of the string or line.
  • \[.\] matches any single character surrounded by "[" and "]" since the brackets are escaped, for example: "[a]" and "[b]".