C Regex capturing group

Wednesday, July 9, 2014

I'm having troubles understanding how the regex in C work. Basically I have an XML file (I can't use an XML parser) containing lines like this:



<Node Bla="blabla" Name="this is my name" .... />
<Node Name="this is my name" Bla="blabla" .... />


What I would like to do is extract the name part of each line. So far I have been using the following regex:



char *regex_str = "Name=\"([^\"]*)\"";


But this gives me Name="this is my name", I'm only looking for the this is my name part.


What am I doing wrong?







http://ift.tt/VJ6Uf9