User: Password:
Subscribe / Log in / New account

globs vs regexps

globs vs regexps

Posted Aug 5, 2004 11:34 UTC (Thu) by Lasse99 (guest, #1899)
In reply to: globs vs regexps by rfunk
Parent article: Bash 3.0 released

Actually, the single-star glob '*' is equivalent to the rather complicated
regular expression '^[^.].*$' or even '^[^./][^/]$'.
On the other hand, the simple regular expression '.*' must be expressed by
a set of two filename globs, namely ( '.*' '*' ).
So, it is debatable which syntax is more complicated...

(Log in to post comments)

globs vs regexps

Posted Aug 5, 2004 11:35 UTC (Thu) by Lasse99 (guest, #1899) [Link]

Ooops! That should have been '^[^./][^/]*$'

Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds