Board logo

标题: [已结]findstr两个中文字符串无法正确匹配的问题 [打印本页]

作者: lifenjoiner     时间: 2008-12-3 22:57    标题: [已结]findstr两个中文字符串无法正确匹配的问题
findstr帮助中有下:

除非参数有 /C 前缀,请使用空格隔开搜索字符串。
例如: 'FINDSTR "hello there" x.y' 在文件 x.y 中寻找 "hello" 或
"there" 。 'FINDSTR /C:"hello there" x.y' 文件 x.y 寻找
"hello there"。

--------------------------------------
我试过:两个英文字符串可以;两个中文字符串不行~

test.txt


用户:所有分组(QQ好友)

==================================================
消息组:我的好友(4)
==================================================
消息类型:地址薄
==================================================

--------------------------------------------------
消息对象:小四(11111111111)
--------------------------------------------------
用户号码 1111111111

昵称

年龄 0

~

Mirabilis ICQ NO

GSM手机

~

--------------------------------------------------
消息对象:Smile(22222222222)
--------------------------------------------------
用户号码 222222222222



command1 OK!
findstr "ICQ GSM" a.txt>z.txt


command2 !不通~
findstr "消 用" a.txt>z.txt

=============
哎,windows不是专门为中国人设计的。
各位有否实现方法?
~~~~~~~~~~~~~
没兴趣吗?来点具体的。
QQzone便捷察看器

Last edited by HAT on 2008-12-4 at 21:11 ]

作者: moniuming     时间: 2008-12-3 23:30
弄错了...

Last edited by moniuming on 2008-12-3 at 23:34 ]

作者: terse     时间: 2008-12-4 02:03
findstr /r "消 用" test.txt>z.txt

作者: lifenjoiner     时间: 2008-12-4 20:44
嗯,不错!谢谢!
似乎让人费解啊。没见过还真想不到。两个"或"的字符串就是表达式啦!