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-Thread: 103376,6ee6f1f1506a654b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Regular Expressions in Ada 2005? From: Georg Bauhaus In-Reply-To: <1163019181.939463.219520@h48g2000cwc.googlegroups.com> References: <1163019181.939463.219520@h48g2000cwc.googlegroups.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: # Message-ID: <1163020490.7172.33.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Date: Wed, 08 Nov 2006 22:14:51 +0100 NNTP-Posting-Date: 08 Nov 2006 22:12:24 CET NNTP-Posting-Host: 81357ecf.newsspool2.arcor-online.net X-Trace: DXC=eL7=cIfe[d<=FQB?mjjV50A9EHlD;3Yc24Fo<]lROoR1Fl8W>\BH3Y2Q\OId>O0_? On Wed, 2006-11-08 at 12:53 -0800, matthias.kistler@gmx.de wrote: > Hi! > > Does anybody know, if it's possible to use regular expressions in Ada > 2005? I come from Perl and I'm very interested in Ada but it's useless > for me without the possibility of using regular expressions similar to > Perl. Ada comes with a rich set of string manipulation packages, Ada.Strings.*, Ada.Characters.*, Ada.*Text_IO.Editing. They cover a fair bit of what you would do using Perl's expressions and translation operators in a sane way. > I found a GNAT-package providing only a regex-matcher. But I also > need a replacer. Elsewise it'd be useless for me. The GNAT packages do provide scanning and replacement. There is a tutorial in the package specifications. Example programs: http://shootout.alioth.debian.org/gp4/benchmark.php?test=regexdna&lang=gnat&id=3 http://shootout.alioth.debian.org/gp4/benchmark.php?test=regexdna&lang=gnat&id=4 #3 uses Unix style regular expressions. #4 uses SPITBOL regular expressions. SPITBOL patterns are quite powerful and fast, in fact you can write an entire program just as a pattern. But don't do that. Georg