One way to approach it:
x <- c("$abc.MSFT", "$MSFT", "$msft", "$abcMSFTxyz")
Tweets <- data.frame(V2=x, stringsAsFactors=F)
Tweets
# V2
#1 $abc.MSFT
#2 $MSFT
#3 $msft
#4 $abcMSFTxyz
#your way
dplyr::filter(Tweets, grepl("\\bMMM$\\b", ignore.case = TRUE, V2))
[1] V2
<0 rows> (or 0-length row.names)
#another way
dplyr::filter(Tweets, grepl("^\\$msft$", ignore.case = TRUE, V2))
V2
1 $MSFT
2 $msft
From regex help:
..there are 12 characters with special meanings: the backslash \, the
caret ^, the dollar sign $, the period or dot ., the vertical bar or
pipe symbol |, the question mark ?, the asterisk or star *, the plus
sign +, the opening parenthesis (, the closing parenthesis ), and the
opening square bracket [, the opening curly brace {, These special
characters are often called "metacharacters".
And the fix:
If you want to use any of these characters as a literal in a regex,
you need to escape them with a backslash. If you want to match 1+1=2,
the correct regex is 1\\+1=2. Otherwise, the plus sign has a special
meaning.
Research regular expressions. They are worth the time to learn whatever language you wish to program in.