🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #106935

Re: [slrn] Need to define space character in macro

#106935
From: J.B. Nicholson-Owens
Date: Sun, 28 Jul 2002 00:17
27 lines
1994 bytes
Keith wrote:
> wann = string_match(whois,"\\C\\(\\<[-_0-9a-z.]*[^.][-_0-9a-z.]*\\>\\)",1);
> 
> I need the above line to include the space character for a 
> slang macro in slrn. Thanks for any help. 

First, it appears you're trying to get a case-insensitive match ("\\C").  I
don't think that is available in S-Lang regular expressions, only in slrn's
scoring.  More precisely, I think "\\C" will match a backslash followed by a
capital "C" which, I'm guessing, is not what you want.  Changing the case of
the string to be searched will fix that:

  string_match (strlow (whois), ...);

Second, you seem to want to capture the entire matched string.  Perhaps you
could use "string_match_nth (0)" instead of placing the capturing
parentheses where you did?

Finally, I can't figure out where you wanted to include a space.  Spaces can
be matched literally simply by putting the space character wherever you wish
it to match:

  string_match (strlow (whois), "\\<[-_0-9a-z. ]*[^.][-_0-9a-z. ]*\\>", 1);

But apropos of nothing, I can't determine where inserting a space would
help.
Technical Details
Message-ID: <slrnak6eto.r3g.jbn@forestfield.org>
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!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!forestfield.ORG!not-for-mail
References: <uqs09.662232$352.138873@sccrnsc02>

Show Full Headers
Complete Article Headers
Message-ID: <slrnak6eto.r3g.jbn@forestfield.org>
Subject: Re: [slrn] Need to define space character in macro
Date: Sun, 28 Jul 2002 00:17:54 +0000
From: "J.B. Nicholson-Owens" <jbn@forestfield.org>
References: <uqs09.662232$352.138873@sccrnsc02>
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!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!forestfield.ORG!not-for-mail
Newsgroups: news.software.readers
Organization: Forest Field OmniMedia
Lines: 26
NNTP-Posting-Host: forestfield.org (208.216.67.173)
X-Trace: fu-berlin.de 1027815474 33504305 208.216.67.173 (16 [35848])
User-Agent: slrn/0.9.7.4 (Linux)