def search_pattern(regex):
prog = re.compile(regex)<EOL>def checker(v):<EOL><INDENT>result = prog.search(v)<EOL>if result is None:<EOL><INDENT>raise ValueError(v)<EOL><DEDENT><DEDENT>return checker<EOL>
Return a value check function which raises a ValueError if the supplied
regular expression does not match anywhere in the value, see also
`re.search`.