Tutorial by Examples

A group is a section of a regular expression enclosed in parentheses (). This is commonly called "sub-expression" and serves two purposes: It makes the sub-expression atomic, i.e. it will either match, fail or repeat as a whole. The portion of text it matched is accessible in the remai...
Since Groups are "numbered" some engines also support matching what a group has previously matched again. Assuming you wanted to match something where two equals strings of length three are divided by a $ you'd use: (.{3})\$\1 This would match any of the following strings: "abc$...
Some regular expression flavors allow named capture groups. Instead of by a numerical index you can refer to these groups by name in subsequent code, i.e. in backreferences, in the replace pattern as well as in the following lines of the program. Numerical indexes change as the number or arrangemen...

Page 1 of 1