I want to grep for a string which begins with a colon :
, the contains 0 or more characters of anything, and then ends with the string mystring
.
I tried this: grep -rI ':*mystring' .
but this did not work.
From searching, I believe the reason this does not work is because it is matching "0 or more instances of the colon character :
followed by mystring
. (See an answer on this question)
That doesn't make much sense to me, hence my question.
Edit: None of the answers in the linked question solve this problem. There is no mention of matching a colon character, and trying to adapt the answers does not work either.