But will that run for every occurrence, or just once?

My reason for using a function is basically this sentence:

> If repl is a function, it is called for every non-overlapping occurrence of pattern. The function takes a single match object argument, and returns the replacement string. For example: