I have the following in C#:
public static bool IsAlphaAndNumeric(string s) { return Regex.IsMatch(s, @\"[a-zA-Z]+\") && Regex.IsMatch(s,
You could use [a-zA-Z].*[0-9]|[0-9].*[a-zA-Z], but I'd only recommend it if the system you were using only accepted a single regex. I can't imagine this would be more efficient than two simple patterns without alternation.
[a-zA-Z].*[0-9]|[0-9].*[a-zA-Z]