So I've been reading a little bit on regular expressions and how to make one. After reading a little bit on what each character meant, I decide to make a very simple regular expression to get me started.
Code:
#include <stdio.h>
int main()
{
char str[128] = {0};
scanf("%[Nn]*icks", str);
printf("%s\n", str);
return 0;
}
the printf function is suppose to print out words that start out with the letter N or n and end with any of the remaining characters.
So words like Nick, nick, ick, nnick, etc matches the pattern that I left in the scanf function. However, at its current state, printf only prints N or n and nothing more.
What am I missing?