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,d0d259074af661a2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-27 14:29:08 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: mark.a.biggar@attbi.com (Mark Biggar) Newsgroups: comp.lang.ada Subject: Re: regex with ada? Date: 27 Dec 2001 14:29:07 -0800 Organization: http://groups.google.com/ Message-ID: <26a50b81.0112271429.4421d165@posting.google.com> References: NNTP-Posting-Host: 207.175.225.48 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1009492148 29640 127.0.0.1 (27 Dec 2001 22:29:08 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 27 Dec 2001 22:29:08 GMT Xref: archiver1.google.com comp.lang.ada:18344 Date: 2001-12-27T22:29:08+00:00 List-Id: "Will May" wrote in message news:... > 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