I'd like to write an elisp function that tells me the line number of the closest regex match above my current cursor position.
For example, if my cursor is on line 9
of the following file and my regex pattern is ^george
, then the line number is 6
.
1 john
2 paul
3 george
4 ringo
5 hello world
6 george ringo
7 john paul
8 hello george
9 paul
10 george