Sujet : Re: Globbing versus regular expressions
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.unix.shellDate : 05. Aug 2024, 05: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.comvoid Void(void) { Void(); } /* The recursive call of the void */