I want to convert
.waitForVisible('.someselector')
.click();
Into:
.waitAndClick('.someselector');
Automatically in a lot of files. So I wrote:
(defun hhaamm-replace-regexp-in-buffer (from to)
(goto-char (point-min))
(while (search-forward-regexp from nil t)
(replace-match to nil nil))
)
And I'm calling it in this way:
(hhaamm-replace-regexp-in-buffer "waitForVisible(.*)[\t
]*\.click()" "waitAndClick(\1)")
But I'm getting:
.waitAndClick(^A);
The expected result is:
.waitAndClick('.someselector');
Why the regexp group is not being replaced with the first matching group?
I also tried with \0
and it didn't work either.
"waitAndClick(\\1)"
.