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