* regexp: matching a short regexp within a long regexp
@ 2003-12-02 20:20 Patrick Drechsler
2003-12-03 12:36 ` Reiner Steib
0 siblings, 1 reply; 2+ messages in thread
From: Patrick Drechsler @ 2003-12-02 20:20 UTC (permalink / raw)
Hi,
can somebody tell me what I'm doing wrong here? I'm trying to match a
few mailing-lists for archiving (working method was posted here[1]).
--8<------------------------schnipp------------------------->8---
;; works:
((string-match "\\.gnus$\\.\\|.emacs\\.\\|.editoren$" group-plain) "Emacs")
;; Unix/Linux
((string-match "\\.os\\.unix\\." group-plain) "Unix")
;; DOESN'T work:
((string-match "\\?suse\\?" group-plain) "Unix")
;; ((string-match "\\.suse\\." group-plain) "Unix")
--8<------------------------schnapp------------------------->8---
How can I match all mailing-lists which include the phrase "suse"?
I thought that one of the two mechanism (. or ?) would work like "no
matter what character shows up"...
Thankful for any pointers,
Patrick
Footnotes: [1]
<v9zngncusv.fsf@marauder.physik.uni-ulm.de>
--
If I'd known I was gonna live this long, I'd have taken better care of
myself. [Eubie Blake]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: regexp: matching a short regexp within a long regexp
2003-12-02 20:20 regexp: matching a short regexp within a long regexp Patrick Drechsler
@ 2003-12-03 12:36 ` Reiner Steib
0 siblings, 0 replies; 2+ messages in thread
From: Reiner Steib @ 2003-12-03 12:36 UTC (permalink / raw)
On Tue, Dec 02 2003, Patrick Drechsler wrote:
> ;; DOESN'T work:
> ((string-match "\\?suse\\?" group-plain) "Unix")
> ;; ((string-match "\\.suse\\." group-plain) "Unix")
> --8<------------------------schnapp------------------------->8---
>
> How can I match all mailing-lists which include the phrase "suse"?
>
> I thought that one of the two mechanism (. or ?) would work like "no
> matter what character shows up"...
Try "suse" or "\\bsuse\\b" see (info "(emacs)Regexps"). The first
will also match foosuseblub, the later will match things like
"foo.suse.bar" or "fasel-suse-list". Your "\\.suse\\." requires a dot
before _and_ after "suse".
> Thankful for any pointers,
(info "(emacs)Regexps") probably is a good starting point.
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- PGP key available via WWW http://rsteib.home.pages.de/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-12-03 12:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-02 20:20 regexp: matching a short regexp within a long regexp Patrick Drechsler
2003-12-03 12:36 ` Reiner Steib
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).