A regular expression is a pattern that matches sets of related character strings. While there are patterns that regular expressions cannot match, they are the power tool most programmers turn to when they need to extract information from legacy text files.

  • Regular expressions are written as character strings (which makes the notation somewhat clumsy).
  • Alphanumeric characters match themselves.
  • Use *, +, and ? for repetition.
  • Use character sets, character set shortcuts, and | to match alternatives.
  • Use parentheses to group things and to extract information from matches.
  • Use the regular expression library to find all matches, replace strings, and perform other operations.

Introduction

Operators

Mechanics

Patterns

More Tools

comments powered by Disqus