StringUtils: Add a utility for checking if a string is a valid regex