views:

25

answers:

1

I need to extract url from XML response. Here is the XML response:

<cloud xmlns:xlink="http://www.w3.org/1999/xlink"&gt;
    <rootContainer xlink:href="https://api.example.net/v2/bucket/92FBC29C-344C-99CF-827E-1B5586A7F8E3"
        xlink:type="simple"/>
</cloud>

I'm using C to write regex. Need help.

my output needs to be https://api.example.net/v2/bucket/92FBC29C-344C-99CF-827E-1B5586A7F8E3

A: 

You shouldn't. If you have the option, you should use an XML processor for any number or reasons.

But if you must, you can do something like "rootContainer.xlink:href=\"([^\"]+)\" Syntax may vary depending on what regex library you're using - there isn't a single "regex" syntax.

MNGwinn