def _get_required_string(parsed, flags):
 (req_offset, required) = parsed.get_required_string(bool((flags & REVERSE)))
 if required:
  required.required = True
  if (req_offset >= UNLIMITED):
   req_offset = (-1)
  req_flags = required.case_flags
  if (not (flags & UNICODE)):
   req_flags &= (~ UNICODE)
  req_chars = required.folded_characters
 else:
  req_offset = 0
  req_chars = ()
  req_flags = 0
 return (req_offset, req_chars, req_flags)

def _get_required_string ( parsed , flags ) : ( req_offset , required ) = parsed . get_required_string ( bool ( ( flags & REVERSE ) ) ) if required : required . required = True if ( req_offset >= UNLIMITED ) : req_offset = ( - 1 ) req_flags = required . case_flags if ( not ( flags & UNICODE ) ) : req_flags &= ( ~ UNICODE ) req_chars = required . folded_characters else : req_offset = 0 req_chars = ( ) req_flags = 0 return ( req_offset , req_chars , req_flags )
gets the required string and related info of a parsed pattern .