6. Expressions
If you give a variable a value (eg $a = 5;) then you use an expression. You also use an operator (eg =).
There are several operators: arithmetic, assignment, bit, comparison, increment, decrement, logical, string, array, and type operators. You can find examples of each operator type in the PHP manual.
Regular expressions.
If you want to check a certain string for validity in the programs you are going to write (e.g. a valid E-mail address or a URL) then you use a pattern. You pass this pattern and the string to be checked as arguments to the function ereg(“pattern”, “string”) or the function eregi(“pattern”, “string”). The ereg() function distinguishes between uppercase and lowercase letters. The eregi() function does not. The ereg() and eregi() functions can no longer be used in PHP version 7. Alternatively, you can use preg_match().
More information can of course also be found in the PHP manual. A search in the manual will take you to the correct description of the function.
An example of an E-mail check: