Yes! Use grep -F
.
From man grep
:
-F, --fixed-strings
Interpret PATTERN as a list of fixed strings, separated by newlines,
any of which is to be matched. (-F is specified by POSIX.)
Test
$ cat a
hello
<a href="/abc/def" class="foo.bar"/>my href</a>
<a href="/abc/def/ghi" class="foo.bar"/>
$ grep -F '<a href="/abc/def" class="foo.bar"/>' a
<a href="/abc/def" class="foo.bar"/>my href</a>
Or with more bash codes:
$ cat a
hello
<a href="/abc/def" class="foo.bar"/>my href</a>
This is/ a $line with some ^codes * yeah
$ grep 'This is/ a $line with some ^codes * yeah' a # no -F, no matches
$
$ grep -F 'This is/ a $line with some ^codes * yeah' a # -F, matches
This is/ a $line with some ^codes * yeah