Skip to content

Instantly share code, notes, and snippets.

Created January 30, 2016 16:21
Show Gist options
  • Save anonymous/fa18c4e544d1b72bfca1 to your computer and use it in GitHub Desktop.
Save anonymous/fa18c4e544d1b72bfca1 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <string.h>
void find(char *aim,char *buffer){
char *start,output[1024],now = ' ';
int count = 0,count_char = 0,buffer_len = strlen(buffer);
start = buffer-1;
strcat(aim,"=\"");
while(count<buffer_len){
start = start+1;
if(strstr(start, aim)!=NULL){
start = strstr(start, aim)+sizeof(aim);
}
else{
break;
}
count_char = 0;
while(*(start+count_char)!='"'){
output[count_char]=*(start+count_char);
count_char++;
}
output[count_char]='\0';
printf("%s\n",output);
}
}
int main(){
char a[] = "<p>Remember, the <strong>only thing</strong> before everything, is to have a dogma. A dogma is a list consists by DOs and DONTanswer=\"Css\"s. You make it, stick to it while adapt it to reality, question yourself from time to time: is everything on the list mutuallanswer=\"A\"y exclanswer=\"B\"usive and collectively eanswer=\"BBB\"xanswer=\"CC\"hausive?</p>\"";
char aim[] ="answer";
find(aim,a);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment