Regex (or regexp) is known as regular expression matching of patterns, strings or characters in, for example, a large text file. Questions should be tagged as such whatever the programming language involved and the tag can also apply to command-line or graphical programs that have regex plugins or some regex capability.

The syntax of regular expressions varies between programming languages, and the formulations developed can vary from the simple to the ultra-complex. Probably the simplest form of regex is what takes place in the shell when a search is performed, for example for files matching *.jpg, and all jpgs within the current working directory are found.

At this site the different types of regex are introduced; Basic Regular Expressions (BRE), Extended Regular Expressions (ERE) and Perl-compatible Regular Expressions (PCRE). However, different programs will have different regular expression capabilities. Shell programs such as grep and sed have special switches that enable them to use more advanced regular expressions; grep, for example, can use ERE with the -E switch and PCRE with the -P switch.

A very useful general introduction to regex and its use in the shell is in chapter 20 of Linux Command and Perl regular expressions are documented in great detail in the official documentation.