Article View: news.software.readers
Article #42714Re: [slrn] those darned regexps again
From: Dawn Owens-Nicholson
Date: Fri, 14 Aug 1998 00:00
Date: Fri, 14 Aug 1998 00:00
48 lines
2660 bytes
2660 bytes
Ian Zimmerman wrote: > I tried to add a score entry to match articles with subjects all in > uppercase. I suggest reading the SCORE_FAQ which should have come with your slrn distribution in the doc/ directory. The question "11. How do I score subject headers that contain only uppercase characters?" would seem to apply. In case you can't find this document, you can get the slrn distribution from ftp://space.mit.edu/pub/davis/slrn/slrn0.9.5.2.tar.gz. [Since none of the cited regular expressions did what the poster wanted and since the FAQ lists regular expressions that work, there's no point in going over where the cited regular expressions fail.] > 1/ does the string matched in scoring include the header name (e.g., > "Subject: ")? Yes, but not in the portion you have to worry about. The header is listed in your scorefile to tell slrn what header you're matching against (in this way, you still have to supply the header), the content is the part you write the regex for. > 2/ does the "^" anchor match at the beginning of a header string? Yes. > 3/ what the h*ll else am I doing wrong? Not reading the SCORE_FAQ and getting one way to do it from there. There are other ways, but since the one listed there works... > 4/ now does anybody see why I pine for GNU/Emacs regexps? Actually, not for any of the problems you're having. However, for reasons not germane to this discussion, I could see why a more flexible & powerful regex engine would be desirable. For instance, I wish S-lang's regex engine had alternation, grouping, and the kind of customization found in Python's regex engine (at least, according to what I read in Friedl's "Mastering Regular Expressions". I don't keep up with Python, so I don't know how current his comments are). > Ian T Zimmerman <itz@rahul.net> Is itz@rahul.net where you prefer mail to be sent? itz@kronstadt.boxmail.com is where your From: address pointed and I don't see any header pointing me to itz@rahul.net.
Technical Details
Message-ID:
<slrn6t94lm.bro.bluemoon@ux6.cso.uiuc.edu>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mailReferences:
<slrn6t8s6m.uoq.itz@kronstadt.rahul.net>Show Full Headers
Complete Article Headers
Message-ID: <slrn6t94lm.bro.bluemoon@ux6.cso.uiuc.edu> Subject: Re: [slrn] those darned regexps again Date: Fri, 14 Aug 1998 00:00:00 +0000 From: bluemoon@ux6.cso.uiuc.edu (Dawn Owens-Nicholson) References: <slrn6t8s6m.uoq.itz@kronstadt.rahul.net> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail X-Deja-AN: 381210326 Organization: University of Illinois at Urbana-Champaign Newsgroups: news.software.readers