Contents

  Icon

Grouping expressions

Anchors

Basic metacharacters

Character classes

Comments

Control and code

Grouping

Look around

Mode modifiers

Quantifiers

Specific characters

You can group part of a pattern into a subpattern by using parentheses. There are two variations. Groups can be either remembered in a variable, (capturing), or not.


 

Item

 

Meaning:

 
 

(…)

 

Capturing parentheses.

 
 

(?:…)

 

Non capturing parentheses.

 
 

(?>…)

 

Non backtracking, non capturing, parentheses.

 
 

In the table “…” stands for any one or more characters.