PHP Pattern Match Extenders: – String Function

 
? = Previous item is match 0 or 1 times.
 
    * = Previous item is matched 0 or more times.
 
    + = Previous item is matched 1 or more times.
 
    {n} = Previous item is matched exactly n times.
 
    {n,} = Previous item is matched at least n times.
 
    {n,m} = Previous item is matched at least n and at most m times.
 
    ? (after any of above) = Match as few as possible times.

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.