Auxiliary function used by REGEX-REPLACE andREGEX-REPLACE-ALL. POS-LIST contains a list with the start and endpositions of all matches while REG-LIST contains a list of arraysrepresenting the corresponding register start and end positions.