declare parameters before preg_match as it will trip up code analyzers as preg_match will set the value to null if the regexp fails