I am trying to match a regex using this code
(search-backward-regexp "\n[\t\n ]*?\n" nil "NOERROR" 1)
search-backward-regexp documenation says
Set point to the beginning of the match, and return point.
How can I set point to end of match?
This is a minor modification to @Malabarba's answer. It only goes to
match-end if your search succeeds. Otherwise, the
goto-char will send you off to wherever you had a successful match on a prior regexp search (whether you initiated it, or some other function used it under the hood), which could lead to astonishing jumps.
(when (search-backward-regexp "\n[\t\n ]*\n" nil 'noerror) (goto-char (match-end 0)))
Probably best to wrap this in a function.