containsRegex

containsRegex ( string regex , string _subject ) : bool

Returns true if the regex is found in the code. Else returns false.

Example


data="Hello world" 
if(containsRegex(/(w[a-z]+)/, data)) console("regex found") // -> regex found


See also

regex
regexAll
cleanRegexAll

Parameters

regex

The regex to search for

_subject (optional)

The string in which regex will be searched. It doesn't have to be HTML code, you can put any kind of text in it. If null it is the page code in a FORPAGE script.