PHP Terms Regular Expressions POSIX Quantifiers

 

- Info:

- Quantifiers are used to look for characters based on their frequency or position.

- Character p from below table can be repalced with set [dsa], range [a-z] or sequence (abc).

 

    

EXAMPLE

DESCRIPTION

 

p+

Represents string containing 2 or more p characters.

 

p*

Represents string containing 0 or more p characters.

 

p?

Represents string containing 0 or 1 p.

 

p{2}

Represents string containing sequence of 2 p characters.

 

p{2,3}

Represents string containing sequence of 2 or 3 p characters.

 

p{2,}

Represents string containing sequence of 2 or more p characters.

 

p$

Represents string which ends with p character.

 

^p

Represents string which starts with p character.