🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #541

Re: Regular Expressions

#541
From: Jonathan I. Kamens
Date: Mon, 02 Sep 1991 06:52
35 lines
2434 bytes
In article <20214@darkstar.ucsc.edu>, david@cats.ucsc.edu (David Wright) writes:
|> I think I am now able to do this. However, I cannot use . or * or seeminlgy
|> any combination of them to search for any character.

You don't need to, at least not for the example you gave.

|> For example, suppose the article's subject line is
|> 
|> Subject: V3ixx1a: programable robits in morse code (part 01/3221)
|> 
|> how can I represent a string of any character for any length so I can
|> just go / (part 3221\/3221) /h  

This is just fine.  The only problem with it is the space after the closing
parenthesis.  The parenthesis is the last character on the subject line.  If
you try the pattern you've given above, it won't work, because there's no
space at the end of the line for your pattern's ending space to match against.

You don't need to use .*, which is the sequence that matches against any
sequence of zero or more characters, in this case, because your regular
expressions don't need to match the entire line, they just need to patch part
of it.

Note that the space at the beginning of your expression is OK, because there
*is* a space in the subject line before the opening parenthesis.

I have directed followups to news.software.readers.  Although perhaps I should
have chosen comp.unix.questions, since this has turned into a discussion of
regular expressions.

-- 
Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik@Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8085			      Home: 617-782-0710
Technical Details
Message-ID: <1991Sep2.065200.23318@athena.mit.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!gmdzi!unido!mcsun!uunet!snorkelwacker.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!jik
References: <19929@darkstar.ucsc.edu| <20008@darkstar.ucsc.edu| <20214@darkstar.ucsc.edu>

Show Full Headers
Complete Article Headers
Message-ID: <1991Sep2.065200.23318@athena.mit.edu>
Subject: Re: Regular Expressions
Date: Mon, 02 Sep 1991 06:52:00 +0000
From: jik@athena.mit.edu (Jonathan I. Kamens)
References: <19929@darkstar.ucsc.edu| <20008@darkstar.ucsc.edu| <20214@darkstar.ucsc.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!gmdzi!unido!mcsun!uunet!snorkelwacker.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!jik
Newsgroups: news.newusers.questions,news.software.readers
Sender: news@athena.mit.edu (News system)
Followup-To: news.software.readers
Organization: Massachusetts Institute of Technology
Lines: 35
Nntp-Posting-Host: portnoy.mit.edu