What is "preg-match"

The preg_match is a function supported from version 4 of PHP who uses regular expressions (Regex) for matches of a pattern (Pattern) in a string.

The function accepts up to 5 parameters, the first 2 being mandatory:

first. The regular expression (standard or Pattern);

2nd. To string that will be subjected to the standard.

Basic syntax:

preg_match(/expressão_regular/, $string);

Useful links: