🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #28129

Re: NX - kill $ signs

#28129
From: Xriva Znegva
Date: Fri, 06 Dec 1996 00:00
45 lines
2215 bytes
In article <5871pp$i8_002@miketoth.mc.net>,
   tothmike@mc.net (Spaminator) wrote:

> So, you have to be VERY careful with the "$". It's like 
> the "*" in DOS/Unix. 

No it isn't!  NO, NO, NO!  It indicates THE END OF THE STRING.

Wombat$   means "Wombat as the last thing on the line."
^Wombat   means "Wombat as the first thing on the line."
^Wombat$  means "Wombat is the ONLY thing on the line"
       because it's anchored at both the head and the tail.

This gives you the flexibility to pick and choose between:

 "Wombats are an important natural resource" and
 "I once had carnal knowledge of a Wombat"

..even though they both contain the identical substring 
"Wombat".

The problem is that if you put a $ at the start of your
test, you're testing for "any line that has an end" -- which
means you match every possible line.  THAT's why it appears
that the dollar sign is acting like a wildcard.

The answer to the original poster's problem -- which you
actually quoted, for Valen's sake! -- is that you have to 
"escape" the dollar sign with a backslash to take away
its special meaning as an anchor.

If you say \$* the backslash makes the dollar sign a literal
thing to be matched, and it's the * that means "any number of 
them."  Killing \$\$\$ will kill based on the presence of 
exactly three dollar signs.  A plain, un-escaped dollar sign
should only appear as the LAST thing in the expression, because
that's the only place it makes any sense.

-- 

Kevin Martin <pnaaba@avp.pbz>  V trg znvyfcnzzref' nppbhagf lnaxrq!
             ROT13 the above to get my reply address

Technical Details
Message-ID: <589t7e$ot2@spruce.citicorp.com>
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
References: <582nbv$95r$3@nic.ott.hookup.net> <5871pp$i8_002@miketoth.mc.net>

Show Full Headers
Complete Article Headers
Message-ID: <589t7e$ot2@spruce.citicorp.com>
Subject: Re: NX - kill $ signs
Date: Fri, 06 Dec 1996 00:00:00 +0000
From: pnaaba@avp.pbz (Xriva Znegva)
References: <582nbv$95r$3@nic.ott.hookup.net> <5871pp$i8_002@miketoth.mc.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: 202942719
Distribution: citi
Organization: See my .sig
Newsgroups: news.software.readers