comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <bauhaus@futureapps.de>
Subject: Re: Regular Expressions in Ada 2005?
Date: Wed, 08 Nov 2006 22:14:51 +0100
Date: 2006-11-08T22:12:24+01:00	[thread overview]
Message-ID: <1163020490.7172.33.camel@localhost.localdomain> (raw)
In-Reply-To: <1163019181.939463.219520@h48g2000cwc.googlegroups.com>

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 






  reply	other threads:[~2006-11-08 21:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-08 20:53 Regular Expressions in Ada 2005? matthias.kistler
2006-11-08 21:14 ` Georg Bauhaus [this message]
2006-11-08 21:49 ` Pascal Obry
2006-11-08 22:12   ` matthias.kistler
2006-11-09  0:13 ` Jeffrey R. Carter
2006-11-09  0:14   ` Jeffrey R. Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox