Regular expressions can be used in various software tools/languages that have support for a regular expression engine. We use the .Net flavor of regular expressions.

You can find documentation on Regular Expressions here

Also, a great free tool to design and analyze regular expressions is Expresso. You can download it here.

Some common regular expressions are the below:

  • (?<=^|\r?\n).*?%String_To_Find%.*?(?=\r?\n|$) …. match an entire line/record containing String_To_Find (%String_to_Find% … variable containing your string to match)
  • (?<=xxxxx) …. means must be prefixed by xxxxx
  • ^ …. means match at start of string
  • | …. means OR (alternation)
  • \r? …. optional CR (carriage return)
  • \n …. LF (line feed)
  • (?<=^|\r?\n) …. must be prefixed with the first record OR the start of a succeeding record (i.e. after the line break – CRLF).
  • .*? …. “.” (any character), “*” (repeated 0 or more times), “?” lazy – not too aggressive in matching.
  • (?=\r?\n|$) …. must be suffixed by a line break (\r?\n) or a last record without a line break ($ = end of string).