JavaScript and RegEx
regular expressions + string variable + javascript
var body = "this is a \n blob of text that could be an article or whatever.";
var search_string = "Blob of text";
var re = new RegExp(search_string, "gim");
var output = body.match(re);
console.log(output);
if ( body.match(re) ) {
console.log("match");
} else {
console.log("no match");
}
From JR's : articles
53 words - 350 chars
created on
- #
source
- versions