[DGD] parse_string() implementation of regex (was: Memory usage)

Tavis Elliott tavise at nwlink.com
Fri Mar 14 21:02:56 CET 2003


On Fri, 14 Mar 2003 13:43:25 -0600, Erwin Harte <harte at xs4all.nl> wrote:

> [...]
> Well, with most regexp packages you can do things like this (I'll
> write how I'd do it in perl):
>
> if ($str =~ /^(\S+):((\d+)\s+)?Foo\s+([a-z])$/) {
> print "$1; $2; $3; $4\n";
> }
>
> Match the pattern and be able to use the (sub)matches.  How would you
> do that one? :)
>

My first attempt was something "simple".  Does the regexp match anywhere in 
the string?  If yes return 1, if no return 0.  I don't feel confident 
enough in what I'm doing to try something more difficult yet.

> [...]
>> no one has implemented this yet ... Everyone who is smarter than me, and 
>> who has done so, must be shy.  :)
>
> Or too busy with other `more important' things in life. ;-)
>

Well, there is that.  Wait, what are implying ?!  ;-)
-T.

---------------------------------------------------
Busier than a one-legged Riverdancer.
_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list