def get_command_regexp(prefix, command):
 prefix = re.sub(u'(\\s)', u'\\\\\\1', prefix)
 pattern = u'\n        (?:{prefix})({command}) # Command as group 1.\n        (?:\\s+              # Whitespace to end command.\n        (                   # Rest of the line as group 2.\n        (?:(\\S+))?          # Parameters 1-4 as groups 3-6.\n        (?:\\s+(\\S+))?\n        (?:\\s+(\\S+))?\n        (?:\\s+(\\S+))?\n        .*                  # Accept anything after the parameters.\n                            # Leave it up to the module to parse\n                            # the line.\n        ))?                 # Group 2 must be None, if there are no\n                            # parameters.\n        $                   # EoL, so there are no partial matches.\n        '.format(prefix=prefix, command=command)
 return re.compile(pattern, (re.IGNORECASE | re.VERBOSE))

def get_command_regexp ( prefix , command ) : prefix = re . sub ( u'(\\s)' , u'\\\\\\1' , prefix ) pattern = u'\n        (?:{prefix})({command}) # Command as group 1.\n        (?:\\s+              # Whitespace to end command.\n        (                   # Rest of the line as group 2.\n        (?:(\\S+))?          # Parameters 1-4 as groups 3-6.\n        (?:\\s+(\\S+))?\n        (?:\\s+(\\S+))?\n        (?:\\s+(\\S+))?\n        .*                  # Accept anything after the parameters.\n                            # Leave it up to the module to parse\n                            # the line.\n        ))?                 # Group 2 must be None, if there are no\n                            # parameters.\n        $                   # EoL, so there are no partial matches.\n        ' . format ( prefix = prefix , command = command ) return re . compile ( pattern , ( re . IGNORECASE | re . VERBOSE ) )
return a compiled regexp object that implements the command .