I want to match two or more consecutive lines with numbers only, e.g.:
abc
1
2
abc
In Emacs, my regex is \(^ *[[:digit:]]+ *$^J\)\{2,\}
, but it doesn't match any. I find \(^ *[[:digit:]]+ *^J\)\{2,\}
can match.
Isn't it true that $
doesn't consume a character, but signals the end of a line (just before a newline character)?
In Python, I remember it doesn't matter that I specify $\n
or \n
. So why does it matter in Emacs? Thanks.