Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Casper Hansen 1 post 21 karma points
    Sep 11, 2013 @ 14:50
    Casper Hansen
    0

    Umbraco macro string into KeyValuePair

    I have a string that looks like this:

    <?UMBRACO_MACRO redirectto="/sagen.aspx" loginpage="/Login.aspx" macroAlias="BrowserValidation" />
    

    The string is from a nodes (NodeFactory) property "bodyText".

    I want to get a list of KeyValuePair<string, string> where the key is the first part and value is the second part. An example would be:

    • Key: redirectto Value: /sagen.aspx
    • Key: loginpage Value: /Login.aspx
    • Key: macroAlias Value: BrowserValidation

    Im thinking of using regular expressions but to be honest I don't where to start. I know I can use \"(.*?)\" to get the values, but I don't know how to get the keys.

Please Sign in or register to post replies

Write your reply to:

Draft