Hello USS!
preg_match("/(||)44($||)/", $var);
The first argument of the preg_match function is the Perl compatible Regular Expression.
Each regexp must be within delimiter, which are here the / at the beginning and the / at the end of the string. These delimiter say where the regexp beginns and where it ends.
The rest of the regexp is very easy. We search for a number (here the 44) which stands in the middle of something crypted. The (||) before the 44 means the following.
The | means an alternative. Therefore (a|b) means that the letter a or the letter b can come.
In our regexp we have the alternatives ^ and |.
The ^ (Circumflex) stands for the beginning of the variable $var. The | is an escape sequence because the vertical bar means alternative. So | means the vertical bar as a sign and not as an alternative.
Summa Summarum: Before the 44 there can be either the beginning of the variable or a vertical bar.
So the following 44 will be found with this.
44
|44
445
but not
144
||44.
Now we have also an alternativ after the 44.
($||)
Here we have the sign $ which stands for the end of the variable $var and the known escaped vertical bar.
So the regexp searches for a beginning of the variable or an vertical bar followed by a 44 and followed by a vertical bar or the end of the variable.
We find these 4 situations:
Beginning of the variable content 44 end of the variable content
|44 end of the variable content
beginning of the variable content 44|
|44|
If one of this pattern is in the variable content preg_match returns 1, else it returns zero.
Hope you can follow these explanations.
My english is not perfect.
Marc