开发者

problem while using findstr

I am trying to execute the following pattern in findstr. The findstr is complaining that the

)]%%)

is unexpected at this time.

I passed the following statement

findstr %EndPageSetup(.+)(%%[((LastPage)|(Page: \d+))]%%) g:\files\WDDEF07.tmp

WDDE07.tmp is a postscript file.

the file i used is https://rapidshare.com/files/25开发者_Go百科09921619/WDDEF07.tmp

please help me to solve this error.


I you are running this from a command line or a batch file, the command shell is interpreting | as a pipe, not an alternation like we regexers are used to. In the command shell, | means to take the standard output of the previous command and 'pipe' it into the next command's standard input, like this:

C:\>dir |find ".txt"

I found no reference to alternations in the documentation. If you can find a way to do what you want without alternations, you might try the findstr /G:file option (where file contains the regular expression). This way, you won't have to fight the command shell's special characters.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜