eta.util.general.replaceall

replaceall(str, replist)[source]

Make a list of replacements to a given string in sequence.

Parameters:
  • str (str) – A string whose contents should be replaced.

  • replist (list[tuple]) –

    A list of replacements to make. A replacement is a tuple of one of the following forms:
    • (old, new)

    • (old, new, is_regex)

    If is_regex is given as True for a tuple, the old and new values are interpreted as regex strings.

Return type:

str