Well, both regex and text search ($text) help you to search in text very efficiently. Both have their own advantages and disadvantages, But there are two clear distinctions
regex
Regex doesn't take advantage of indexes, unless you are searching in beginning of string using ^
operator.
Regex allows you to search partial text. therefore .* and so many other patterns.
Regex doesn't support stop or noise words.
$text
text indexes in mongodb are really fast and should be preferred. However, MongoDB does not implement full featured text indexes. One main drawback is, it doesn't support partial match. e.g. if you are searching for cat, it will search only for cat and cats but not bobcat or caterpiller.
Bottom line is if you are looking to implement feature like RDBMS like
operator, '$text' will not help you (at least in current implementations of MongoDB, but in future it may change).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…