Fixing warnings and preg_match new parameter