|
|
@ -42,9 +42,7 @@ int isEscapedChar(char char1, char char2){ |
|
|
|
else if ( char1=='\\'){ |
|
|
|
return 92; |
|
|
|
} |
|
|
|
else return ; |
|
|
|
//if(character==92 || character==7 || character==8 || character==27 || character==12 || character==10 || character==13 || character==13 |
|
|
|
// || character==9 || character==11) |
|
|
|
else return ; //returning nothing for the moment, returning 0 printed weird character, no idea what to do |
|
|
|
} |
|
|
|
|
|
|
|
char *classify(char *spec) |
|
|
@ -106,7 +104,7 @@ char *classify(char *spec) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
else if((spec[index]>=65 && spec[index]<=90) || (spec[index]>=97 && spec[index]<=122)){ |
|
|
|
else if((spec[index]>=65 && spec[index]<=90) || (spec[index]>=97 && spec[index]<=122) || (spec[index]<=57 && spec[index]>=48) ){ |
|
|
|
setBit(class,spec[index]); |
|
|
|
printf("added char : %c\n",spec[index]); |
|
|
|
} |
|
|
@ -121,7 +119,7 @@ char *classify(char *spec) |
|
|
|
index++; |
|
|
|
} |
|
|
|
|
|
|
|
if (spec[0]=="^") { |
|
|
|
if (spec[0]==94) { |
|
|
|
for (int i= 0; i < 8; ++i) class[i] ^= 255; // invert all bits in the class |
|
|
|
} |
|
|
|
|
|
|
@ -135,7 +133,7 @@ int main() |
|
|
|
ssize_t line_len=0; |
|
|
|
char a='a'; |
|
|
|
printf("%i\n",(int)a); |
|
|
|
printf("%s",classify("fgmfa\\-c")); |
|
|
|
printf("%s",classify("a")); |
|
|
|
while ((line_len= getline(&line,&line_max,stdin)) >= 0) { |
|
|
|
if (line_len>0 && line[line_len-1]=='\n') { |
|
|
|
line[line_len-1]=0; |
|
|
|