Regular expressions are a powerful way of analyzing and retrieving values from text strings .
The regular expressions basic syntax
To use regular expressions first you need to learn the syntax of the patterns. We can group the characters inside a pattern like this:
1 Start and end indicators as ^ and $
2 Count indicators like +,*,?
3 Logical operator like |
4 Grouping with {},(),[]
5 \ is used as a general escape character
A basic example would looks like this:
<?php if (preg_match('/tutorial/', 'tips and tutorials are very useful')) {