If your grep has perl-like regex support with -P, you can use look ahead operators for that:
grep -P -e a -e '^(?!.*l)'
Would match on lines that contain a or where the start of the line (^) is not followed ((?!...)) by any number of characters then l.
For the special case of single character search strings here, you can use:
grep -e a -e '^[^l]*$'
Which matches on lines that either contain a or contain only any number (*) of characters other than l ([^l]) from start (^) to finish ($).
perl, sed or awk (sed being the only one of those still supporting basic regexps) would make it easier in the general case. For lines that contain yes or don't contain no:
perl -ne 'print if /yes/ || ! /no/'
sed -e '/yes/b' -e '/no/!d'
(or @muru's variant)
awk '/yes/ || ! /no/'
Below is my original answer where I had misinterpreted the question as asking for lines that include a and not l. I'll leave it here in case that's useful to anyone as it's a connected question.
If your grep includes PCRE support with -P, you can use look ahead operators for that:
grep -P '^(?=.*a)(?!.*l)'
Would match on the start of the line (^) provided it's followed ((?=...)) by any number (*) of characters (.) then a and that it's not followed ((?!...)) by any number of characters then l.
For the special case of single character search strings here, you can use:
grep -x '[^l]*a[^l]*'
Which matches on lines made exactly (as a whole) of any number of characters other than l, one a and any number of characters other than l.
perl, sed or awk would make it easier in the general case. For lines that contain yes and not no:
perl -ne 'print if /yes/ && ! /no/'
sed -e '/yes/!d' -e '/no/d'
sed -ne /no/d -e /yes/p
awk '/yes/ && ! /no/'
grep 'a\|^[^l]*$'awk, the command gives the output that you have and can operate on regular expressions so it fits what you want. If there is some functional reason for not usingawk, what is it? It effectively does the same thing. I'm not an expert onperlbut the same is also true there.-v), and a single character it needs to match.grep -v '^complicatedRegex$\|[^l]'andgrep -v '^complicatedRegex$\|.*[^l].*'didn't work as expected-v), and a single character it needs to match" -- So maybe you need to ask about something more complex than justaandl.|nor\|are allowed in POSIX BRE. The\|is a GNU extension.