Grep with wildcard in middle of word

How can

grep G.*schema

give me the result: ${Gacntg_dt}""'"'

doesn't G.*schema say give me an unlimited number of characters between G and schema?

:confused:

Grep uses regular expressions, not wildcards.

In a regular expression, * stands for 0 or more of the preceding character; a dot is matched by any character.

correct, that what i understood..

so shouldn't G.*schema mean 0 or more of any character between G and schema?

so for ${Gacntg_dt}""'"' i get the 0 or more characters after G but the string schema doesn't get considered as part of the match.

sorry, but i must be missing something...

Please use [code] tags for code, not [color].

Please post the exact code you are using as well as a sample input file.

Note that a search string containing wildcard cahracters should be quoted.