parameters: (regex, directory)
docstring: Checks if `directory` matches `regex` and returns the first match converted
      to an integer. If it does not match -1 is returned.
  
      Arguments:
      - `regex`: Regular expression to be tested against
      - `directory`: name of the directory under test
docstring_summary: Checks if `directory` matches `regex` and returns the first match converted
      to an integer. If it does not match -1 is returned.
docstring_tokens: Checks if directory matches regex and returns the first match converted to an integer . If it does not match - 1 is returned .
function: def get_first_match(regex, directory):
      """
      Checks if `directory` matches `regex` and returns the first match converted
      to an integer. If it does not match -1 is returned.
  
      Arguments:
      - `regex`: Regular expression to be tested against
      - `directory`: name of the directory under test
      """
  
      result = regex.search(directory)
      if result is None:
          return -1
      else:
          return int(result.group(1))
function_tokens: def get_first_match ( regex , directory ) : result = regex . search ( directory ) if result is None : return - 1 else : return int ( result . group ( 1 ) )