From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8b688ddbf65a9e2e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-22 07:48:14 PST Path: newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!colt.net!diablo.netcom.net.uk!netcom.net.uk!news1.ebone.net!news.ebone.net!newsfeeds.net.uni-c.dk!news.net.uni-c.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: GNAT.Regexp: Am I missing something? Date: Sun, 22 Apr 2001 16:48:11 +0200 Organization: Centre for Chaos and Turbulence Studies, Niels Bohr Institute Message-ID: <3AE2EF2B.AB07037F@nbi.dk> References: <3AE06CE9.E1725E0C@earthlink.net> NNTP-Posting-Host: alf.nbi.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.net.uni-c.dk 987950893 40260 130.225.212.55 (22 Apr 2001 14:48:13 GMT) X-Complaints-To: usenet@news.net.uni-c.dk NNTP-Posting-Date: Sun, 22 Apr 2001 14:48:13 +0000 (UTC) X-Mailer: Mozilla 4.77 [en] (X11; U; OSF1 V4.0 alpha) X-Accept-Language: fo,da,no,sv,is,de,fr,en Xref: newsfeed.google.com comp.lang.ada:6837 Date: 2001-04-22T16:48:11+02:00 List-Id: Marc: > So, I anticipated that by doing: > > File_Regexp := Compile("*.log", Glob => True); > > I would end up with a regular expression that would match filenames > ending in ".log". However, that's not what's happening, none of my > ".log" files get matched with that expression. I would guess that the problem is that the function actually expects "true" regular expressions. I.e. "^.*[.]log$" and not "*.log". > I know that GNAT.Regexp can work any way its creator want, but the > behavior doesn't jive with my expectations based on its documentation > claiming support for "wild card patterns used in file names by the Unix > shell". Hmm??? That is something else than regular expressions. Have you tried with "true" regular expressions. > Am I overlooking something? I don't want "true" regular expressions, > I'm just using this to filter filenames based on a user-supplied > pattern, and their expectation would obviously be to use the > filename-matching kind of pattern. Would it be problematic to substitute "." with "[.]", "?" with "." and "*" with ".*"? Enclosed between "^" and "$" your file name pattern should then be transformed to a regular expression with the same effect. Jacob -- "Any, sufficiently advanced, technology is indistinguishable from magic."