pattern searching using C

i think grep can only find char in files matching a pattern without any wildcards like ? correct? It works with * but not ?.

how can i write a small c program to find words in a file, like a list, that matches a pattern like ma?y, b??con, etc if grep doesn't understand ? in a pattern search. if this is the case even b*con if I wanted to write my own pattern search funtion? I tried to use \? but didn't help in my search.

thanks.

With egrep you can use regular expressions.

There is also command line PERL .