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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,be46f06435ab7542 X-Google-Attributes: gid103376,public From: "Terry J. Westley" Subject: Re: Regular Expressions & Ada 95 Date: 1999/02/08 Message-ID: <918499449.4808@outpost1.roc.accglobal.net>#1/1 X-Deja-AN: 442053535 Cache-Post-Path: outpost1.roc.accglobal.net!unknown@worf-gw.calspan.com References: <36BE36C1.11773AB0@dsuper.net> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.0810.800 Organization: Calspan/Veridian X-MSMail-Priority: Normal Reply-To: "Terry J. Westley" Newsgroups: comp.lang.ada Date: 1999-02-08T00:00:00+00:00 List-Id: TASH is an Ada 95 binding to Tcl/Tk. Among other things, you'll get regular expression pattern matching. Here's an excerpt from the (hopefully) soon to be released new and improved thick binding. This excerpt and the example provide regular expression pattern matching to find patterns in elements of Tash lists. There will also be the capability to perform regular expression matches directly on strings as well. I just happening to be finishing up the list regexp match right now. -------------------------------------------------------- -- Use regular expressions to search a list. Index returns -- the index (in the range 1..Length(Source)) in Source -- of the element which matches the specified regular -- expression. Returns 0 if the pattern is not found. -------------------------------------------------------- function Index (Source : in Tash_List; Regexp : in String; Going : in Ada.Strings.Direction := Ada.Strings.Forward) return Natural; Here's an example: declare use type Tash.Lists.Tash_List; Target_String : Tash.Lists.Tash_List := Tash.Lists.To_Tash_List ( +"this Tash string is an element of a Tash list", +"here's a second element"); begin if Tash.Lists.Index (Target_String, "[tT][aA][sS][hH]") > 0 then Ada.Text_IO.Put_Line ("Tash found"); end if; end; -- Terry J. Westley, Principal Engineer Veridian Engineering, Calspan Operations twestley@buffalo.veridian.com http://www.veridian.com/ ------------------------------------------------------- Author of TASH, an Ada binding to Tcl/Tk. Visit the TASH web site at http://tash.calspan.com. -------------------------------------------------------