I have strings in the following format:
<a href="../site0/page0_2279.html"> ../site0/page0_2279.html </a><br/>
What I am trying to do , is to store the href link to a string variable in C. My try so far, that doesn't seem to work:
char htmltag[200];
strcpy(htmltag,"<a href=\"../site0/page0_2279.html\"> ../site0/page0_2279.html </a><br/>");
char link[120];
char samelink[120];
sscanf(htmltag,"<a href=\"../%s\"> ../%s </a><br/>",link,samelink);
printf("%s %s\n",link,samelink);
Note: I am trying to get only the bold part of the link ../site0/page0_2279.html
EDIT:
I found a temporary solution that works for me , so I post it , but I leave it open for more appropriate ones.
char* link;
strtok(temp, "\"\""); // tokenize till first double quotes
link = strtok(NULL, "\"\""); // get the main part
printf("Link: %s \n",link+3); // remove ../