If you want to match a string entirely if it does not contain a certain substring, use a regex to match the substring, and return the whole string if the regex does not match. You didn't say which language you're using, but you tagged your question with .NET, so here goes in C#:
if (Regex.IsMatch(subjectString, "</EM>")) {
return null;
} else {
return subjectString;
}
Since is just a bit of literal text, you don't even need to use a regular expression:
if (subjectString.Contains("</EM>")) {
return null;
} else {
return subjectString;
}
In a situation where all you could use is a regex, try this:
\A((?!</EM>).)*\Z
The regex-only solution will be far less efficient than the above code samples.