On Friday, May 10, 2002, at 10:52 , Eric Wang wrote:

> Can you explain what all that means?
> specifically the /!([^!]*)/g part
> and the $1 part
>
> I only had limited automaton experience
> thanks for your time

the scary part is that this is part of the Regular Expression Game,
and less to do with 'automaton' - but as we all know RegEx is dead
since this can 'all be done so much simpler in XML'....

david grays may be easier to explain:

        my $jims = "!23!auntie45!67";
        my @nums = ();
        #push @nums,$1 while $jims =~ /!?(\d+)/g;       # the '?' is extraneous

        while ($jims =~ /!              #find a ! token
                                        (\d+)   # find one or more digits -
                                                        # put in $1 special variable 
if we match
                                        /gx ) { # do this globally through the string
                # enter the loop any time we have a match
                push @nums,$1 ;         # accumulate the matched things in @nums
        }



ciao
drieux

---


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to