Got more questions? Find advice on: ASP | SQL | XML | Windows
Welcome to RegexAdvice Sign in | Join | Help

Reading specific values from string:

  •  08-09-2008, 8:03 PM

    Reading specific values from string:

    I'm trying to read some specific values from a string.

    elementName = "item add item:mk0090 destination:project1";

     You can see there two  key:value  pairs. How can I find this value knowing an key ?

    Matching 'item:mk0090' or 'destination:project1' is easy:

    elementID.match( '/\b' + 'item' + ':[A-Z0-9]\b/', elementName);

    ==> item:mk0090

    but how to capture for corresponding item value or destination value with regular expression which works also with IE6 (starting at Javascript 1.3) ?

    Please help !

View Complete Thread