Re: Globbing versus regular expressions

Liste des GroupesRevenir à cu shell 
Sujet : Re: Globbing versus regular expressions
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.unix.shell
Date : 05. Aug 2024, 04:43:21
Autres entêtes
Organisation : None to speak of
Message-ID : <87y15bd486.fsf@nosuchdomain.example.com>
References : 1 2
User-Agent : Gnus/5.13 (Gnus v5.13)
Ed Morton <mortonspam@gmail.com> writes:
[...]
It'd be annoying and more error-prone if every time you wanted to list
files that start with `s` and end in `.txt` you had to write:
>
    ls ^s.*\.txt$
>
instead of just:
>
    ls s*.txt
>
So, it's just horses-for-courses - globbing patterns make filename
matching simplest most of the time while regexps make text matching
simplest most of the time.

It's far too late to change it, but perhaps if the syntax of regular
expressions had treated '.' as a normal character and used something
else to match a single character, they could have been used both for
text processing and file name matching.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */

Date Sujet#  Auteur
21 Jul 24 * Globbing versus regular expressions10Axel Reichert
21 Jul 24 +- Re: Globbing versus regular expressions1Janis Papanagnou
21 Jul 24 +- Re: Globbing versus regular expressions1Joerg Mertens
21 Jul 24 +- Re: Globbing versus regular expressions1Kaz Kylheku
21 Jul 24 +- Re: Globbing versus regular expressions1Lawrence D'Oliveiro
2 Aug 24 +* Re: Globbing versus regular expressions2Ed Morton
5 Aug 24 i`- Re: Globbing versus regular expressions1Keith Thompson
2 Aug 24 `* Re: Globbing versus regular expressions3Ed Morton
10 Aug 24  `* Re: Globbing versus regular expressions2Axel Reichert
10 Aug 24   `- Re: Globbing versus regular expressions1Lawrence D'Oliveiro

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal