findstr regular expression missmatch
If I run this CLI command:
pdftotext -l 10 file.pdf - | findstr /i /r "isbn[0-9 xX\-]*"
I don't get a match.
If I output xpdf's pdftotext result to text file:
pdftotext -l 10 file.pdf file.txt
then parse this file in Kiki for example with the same pattern:
开发者_开发知识库isbn[0-9 xX\-]*
I get expected results.
What could be wrong here?
PS stdout from pdftotext is read correctly by findstr
Have you tried some sample inputs with echo isbn1-23-4 | findstr
or similar?
To me it seems that Windows findstr
doesn't understand the bracket [0-9 xX\-]
. However, it seems that echo isbn1-X23-4x | findstr /i /r "isbn[0123456789-xX]*"
works, so you might have some success with
pdftotext -l 10 file.pdf - | findstr /i /r "isbn[0123456789-xX]*"
精彩评论