def parse(<EOL>svalue, conf=None, configurable=None, ptype=None,<EOL>scope=DEFAULT_SCOPE, safe=DEFAULT_SAFE, besteffort=DEFAULT_BESTEFFORT<EOL>):
result = None<EOL>if ptype is None:<EOL><INDENT>ptype = object<EOL><DEDENT>compilation = REGEX_EXPR.match(svalue)<EOL>_scope = {} if scope is None else scope.copy()<EOL>if compilation:<EOL><INDENT>lang, expr = compilation.group('<STR_LIT>', '<STR_LIT>')<EOL>result = _exprparser(<EOL>expr=expr, lang=lang, conf=conf, configurable=configurable,<EOL>scope=_scope, safe=safe, besteffort=besteffort<EOL>)<EOL><DEDENT>else:<EOL><INDENT>result = _strparser(<EOL>svalue=svalue, conf=conf, configurable=configurable,<EOL>scope=_scope, safe=safe, besteffort=besteffort<EOL>)<EOL><DEDENT>if not isinstance(result, ptype):<EOL><INDENT>try:<EOL><INDENT>result = ptype(result)<EOL><DEDENT>except TypeError:<EOL><INDENT>result = result<EOL><DEDENT><DEDENT>return result<EOL>
Parser which delegates parsing to expression or format parser.