🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.help
Article #188975

Re: Directory Files

#188975
From: Simon Marshall
Date: Fri, 24 May 1991 13:52
43 lines
2554 bytes
	On 23 May, Anil Joshi (joshi@m.cs.uiuc.edu) writes:

| 1. Why are there so many different reg.exp. suntaxes floating around?
|    Can't the people of UNIX come to some kind of agreement on this
|    issue?

	As the name tells you, Gnu's Not Unix!  The regexp syntax in Unix
     is not good enough (as gaynor@yoko.rutgers.edu (Silver) pointed out),
     so GNU used Gosling's.

| 2. In the emacs syntax to represent the period, I need to escape it but
|    that is not enough. I need to escape the escape (\\). This is
|    totally counter-intuitive (as many things in emacs are). Why o why?
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	Don't say things are "totally counter-intuitive" just because you
     don't understand them!!!  If you don't like it, you can always use vi
     or ed!!!

	BTW, what you really wanted was ".+\\.[ch]$" as the regexp.  It
     means "one or more chars followed by a period followed (and ended) by
     a `c' or `h'".

	Why quote the quote?  Because it's interpreted twice.  Obviously
     you have to quote "\" a period when you want it to mean a period, as
     otherwise it matches single character (that's its definition).  You
     have to quote the quote as the string is evalled when it's passed to
     the function directory-files (that's Lisp), which then uses the
     result.

| 3. Why not make grep of emacs accept emacs reg.exp syntax? That way I
|    have to know only one syntax.

	If you mean running the function "grep" under Emacs, then you must
     remember that it is really just calling Unix's grep to do the job.
     Emacs is just giving you an interface to it.

	Hope things are a little clearer!  Si.
_______________________________________________________________________________
Simon Marshall, Dept. of Computer Science, University of Hull, Hull HU6 7RX, UK
	      "``La la la la la la la la la'' means I love you."
	EMAIL:	S.Marshall@Hull.ac.uk		UUCP:	..!ukc!hu-cs!sm
    Telephone:	+44 482 465951 (office)		 Fax:	+44 482 466666
Technical Details
Message-ID: <29496.9105241352@seq.hull.ac.uk>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!spool.mu.edu!agate!ucbvax!sequent.cc.hull.ac.uk!sm2

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 103b8b,47d8d87ddf6099a4
X-Google-Attributes: gid103b8b,public
X-Google-ArrivalTime: 1991-05-24 12:46:45 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!spool.mu.edu!agate!ucbvax!sequent.cc.hull.ac.uk!sm2
From: sm2@sequent.cc.hull.ac.uk (Simon Marshall)
Newsgroups: gnu.emacs.help
Subject: Re: Directory Files
Message-ID: <29496.9105241352@seq.hull.ac.uk>
Date: 24 May 91 13:52:54 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Lines: 43