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=-0.4 required=5.0 tests=BAYES_00,DATE_IN_PAST_06_12, WEIRD_PORT autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,d5b211b0c1ffcf3e X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Received: by 10.204.154.133 with SMTP id o5mr405372bkw.0.1339693744094; Thu, 14 Jun 2012 10:09:04 -0700 (PDT) Path: e27ni47991bkw.0!nntp.google.com!news1.google.com!postnews.google.com!a16g2000vby.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Practicalities of Ada for app development Date: Thu, 14 Jun 2012 00:35:57 -0700 (PDT) Organization: http://groups.google.com Message-ID: <4bfd57a4-f220-4ab5-b649-b0d9c06db793@a16g2000vby.googlegroups.com> References: <79c5c9f7-4b72-4990-8961-b3e2db4db79b@qz1g2000pbc.googlegroups.com> <98ef69fe-f5af-485b-89b2-9358059f4582@googlegroups.com> <92d44fa9-03ac-4f3a-84ba-4c73bf59392b@re7g2000pbc.googlegroups.com> NNTP-Posting-Host: 153.98.68.197 Mime-Version: 1.0 X-Trace: posting.google.com 1339659476 11462 127.0.0.1 (14 Jun 2012 07:37:56 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 14 Jun 2012 07:37:56 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a16g2000vby.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.1; rv:10.0.4) Gecko/20120509 Firefox/10.0.4,gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-06-14T00:35:57-07:00 List-Id: quiet_lad wrote on comp.lang.ada: > I do not insist. =A0I just see regex used and am amazed there is > alternative. =A0I am also glad there is one. Apart from Ada.Strings.Fixed.Index and Ada.Fixed.Strings.Find_Token, the language does not impose any serious pattern matching. However GNAT comes bundled with both regular expression (GNAT.Regexp) and SNOBOL4 pattern matching engines (GNAT.SPITBOL.Patterns). As Maciej rightly pointed out, regular expressions must be compiled at run time (GNAT.Regexp.Compile). One place where I used GNAT.Rexegp long ago is in the regexp-based spam filter I wrote for myself. It reads regular expressions defining spam from my ~/.emacs file, compiles each in turn and applies the filter to incoming mail retrieved from a POP3 server. http://www.ada-france.org:8081/branch/changes/org.ludovic-brenta.spamkiller -- Ludovic Brenta.