check if argument is string in isStringAndMatchesPattern

Just does what the function name says it should do...

Current behaviour sometimes produces warnings if transformation result is not string 
`Warning: preg_match() expects parameter 2 to be string`