Construct a regular expression from a string, useful for searching:

js
var term = "ma";
var regExp = new RegExp(term, "gi"); // global search, case insensitive
regExp.test("Madonna"); // true