>>>>> ""Bill" == "Bill Stennett <- compuserve" <[EMAIL PROTECTED]>> writes:

    "Bill> Hi All, "Bill> I have a string formatted like this:

    "Bill> my $mystring =
    'var1=123::var2=abc456::var3=10.99::var4=def';

    "Bill> What I need to do is to be able to extract name=value.  I
    cannot be sure "Bill> where in the list a any value will occur so
    to extract a value for 'var2' "Bill> from the above example would
    require matching either:

    "Bill> '::var2=abc456::'

    "Bill> or "Bill> 'var2=abc456::'

    "Bill> or "Bill> '::var2=abc456'

Do it in stages -- first split the string into pieces on the ::, using
"split".  Then split each piece on the =.

-- 
A hacker would consider being asked to write
        add x to y giving z
instead of
        z = x+y
as something between an insult to his intelligence and a sin against God.
        -- Paul Graham (http://paulgraham.com/popular.html)

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to