\.txt(.*)\n
will match everything between .txt and the line break.
.txt
the . needs to be escaped with \ since its part of the regex syntax.
.
\