[regex] Regex for string contains?

What is the regex for simply checking if a string contains a certain word (e.g. 'Test')? I've done some googling but can't get a straight example of such a regex. This is for a build script but has no bearing to any particular programming language.

This question is related to regex

The answer is


Just don't anchor your pattern:

/Test/

The above regex will check for the literal string "Test" being found somewhere within it.


I'm a few years late, but why not this?

[Tt][Ee][Ss][Tt]