echo a.txt| FINDSTR /R ".+\.txt$"
not work and not even:
echo a.txt| FINDSTR /R .+\.txt$
Why?
Edit:
Now works!
echo a.txt| FINDSTR /R ..*\.txt$
echo a.txt| FINDSTR /R ".+\.txt$"
not work and not even:
echo a.txt| FINDSTR /R .+\.txt$
Why?
Edit:
Now works!
echo a.txt| FINDSTR /R ..*\.txt$
a) There is no + in the regex of Findstr. Use * instead. ..* should be the correct replacement for .+.
b) There can be invisible character before the end of the line, e.g. caused by echo if there's a trailing space before |. Add another . before the line end to cover that.
C:\> echo a.txt | findstr /r ".*\.txt.$"
a.txt
It's also possible without the quotation marks.