开发者

problem while using findstr

开发者 https://www.devze.com 2023-03-14 06:56 出处:网络
I am trying to execute the following pattern in findstr. The findstr is complaining that the )]%%) is unexpected at this time.

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

精彩评论

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

关注公众号