The two most common functions that I think you will come across are preg_match and preg_replace.
We'll start by looking at preg_match. preg_match goes through the given subject to see if it matches the given pattern, which is the simplest form of this function. The function then simply returns 1 if if finds a match or 0 otherwise.
The next important thing to look at is the $matches variable. With a basic call we simply get the match at the first index of the matches array:
preg_match("/ello/", "hello", $matches);
 => ello
As stated on php.net "If matches is provided, then it is filled with the results of search. $matches will contain the text that matched the full pattern, $matches will have the text that matched the first captured parenthesized subpattern, and so on. "
So what we will see in $matches etc. is the text that matched parenthesized subpatterns. Let's look at a simple example:
You can see clearly that in $matches we have the full text match and in $matches we have the l that matched in the parenthesis. Note that as we are using preg_match it will only show the first match and not subsequent matches although the second 'l' also matches. This is covered in the function preg_match_all.
$subject = "hello";
preg_match("/he(l)+o/", $subject, $matches);
 => hello
 => l