I need a single-pass regex for unix grep that contains, say alpha, but does not contain beta.
grep \'alpha\' <> | grep -v \'beta\'
Try using the excludes operator: [^y]*x[^y]*
[^y]*x[^y]*