parsing search/replace regex to support function calls