Sure.
Well this is the most basic example of preg_match:
PHP Code:
if (preg_match("/choice/", "PHP is the web scripting language of choice.")) {
echo "A match was found.";
} else {
echo "A match was not found.";
}
As you can see, the forward slash "/" indicates the start and end of the pattern.
An "i" afterwards makes it case-insensitive.
I can't remember exactly what the "s" means. It's something to do with matching a pattern when there's a new line.
The period (dot) symbol is normally a wildcard (meaning it can stand for any single character). So if you actually want to match a period symbol itself, you need to escape it with a backslash "\" before it.
Yes, "GPO Box" is already covered by the mod. The others will need adding.
Further reference:
http://php.net/manual/en/function.preg-match.php
Bookmarks