comp.lang.ada
 help / color / mirror / Atom feed
From: mark.a.biggar@attbi.com (Mark Biggar)
Subject: Re: regex with ada?
Date: 27 Dec 2001 14:29:07 -0800
Date: 2001-12-27T22:29:08+00:00	[thread overview]
Message-ID: <26a50b81.0112271429.4421d165@posting.google.com> (raw)
In-Reply-To: a0fq61$ks1$1@paris.btinternet.com

"Will May" <will.may@btinternet.com> wrote in message news:<a0fq61$ks1$1@paris.btinternet.com>...
> This (should) be a simple question. Is it possible to do regex commands
> (e.g. s/hello/g) in ada?
> 
> What i want to do is to replace one word with another multiple times and i
> know that it could be easily done with one regex expression.

Well if you don't need wildcard support then every thing you need
for that task can be found in one of the standard packages ada.strings.fixed,
ada.strings.bounded or ada.strings.unbounded.  A combination of the routines
index and replace_slice in aloop will do what you want.

If you need wildcards then look at the two regex packages that come with Gnat,
a snobol clone and a unix regex like system.

--
Mark Biggar
mark.a.biggar@attbi.com



  reply	other threads:[~2001-12-27 22:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-27 18:44 regex with ada? Will May
2001-12-27 22:29 ` Mark Biggar [this message]
2001-12-27 23:05   ` Eric Merritt
2001-12-29 12:35     ` Robert Dewar
replies disabled

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