Probably worth commenting, against this function, that it shouldn't be used in a loop; it's always better to use CompileRegex() before the loop and StringMatchWithPrecompiledRegex() in the loop.