Article View: cn.comp.os.linux
Article #590Re: 问一句正则表达式该怎么写
From: Li
Date: Sun, 13 Sep 2009 01:46
Date: Sun, 13 Sep 2009 01:46
12 lines
2114 bytes
2114 bytes
M-x keep-lines RET gmail RET ?? see http://www.delorie.com/gnu/docs/emacs/emacs_104.html you may also try list-matching-lines (works on whole file) delete-matching-lines (works on region if exist, else work from cursor point to end of file.) delete-non-matching-lines On Sep 12, 6:51 pm, "Moses" <moses.ma...@gmail.com> wrote: > 数据每个一行, 比如是一些邮件地址 > a...@gmail.com > b...@gmail.com > ... > ... > c...@163.com > d...@yahoo.com > e...@hotmail.com > > 现在想将所有不包含某字段 (比如非 Gmail 的) 的行替换为空行, 正则表达式应该怎么写? > 我试了 [^gmail.com]$ 但是只能匹配部分, 像是 @163.com 结尾的就跳过了, 不知道什么原因 > > 谢谢
Technical Details
Message-ID:
<5286773a-2c93-4178-9fa5-8b9c789b9264@q40g2000prh.googlegroups.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!q40g2000prh.googlegroups.com!not-for-mailReferences:
<h8fug1$no0$1@www.shinco.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 3473bcdd2c,da30bf8c4d964ec9 X-Google-Attributes: gid3473bcdd2c,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,GB Path: arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!q40g2000prh.googlegroups.com!not-for-mail From: Li <xingli.talk@gmail.com> Newsgroups: cn.comp.os.linux,cn.fan Subject: Re: 问一句正则表达式该怎么写 Date: Sat, 12 Sep 2009 18:46:27 -0700 (PDT) Organization: http://groups.google.com Lines: 12 Message-ID: <5286773a-2c93-4178-9fa5-8b9c789b9264@q40g2000prh.googlegroups.com> References: <h8fug1$no0$1@www.shinco.com> NNTP-Posting-Host: 122.193.86.125 Mime-Version: 1.0 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: base64 X-Trace: posting.google.com 1252806387 1043 127.0.0.1 (13 Sep 2009 01:46:27 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 13 Sep 2009 01:46:27 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: q40g2000prh.googlegroups.com; posting-host=122.193.86.125; posting-account=SVFgYwoAAACDrBVO3YasCD5UqIaNYKmG User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; zh-CN; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2,gzip(gfe),gzip(gfe)