term()
Creates a function that when called will try to match the given string against strTerm
.
+
preceding a search term indicates that the specified term must exist. A -
preceding a search term indicates that the specified term must not exist. A substring surrounded by the forward slash (/
) indicates a regular expression which can also end with i
flag to indicate case-insensitivity.{ ignoreCase: true }
ignoreCase
property (defaults to true) can be added specified to allow/disallow non-RegExp terms to match strings regardless of casing. The matchWordStart
(defaults to false) can be added to allow plain words to match even if word only starts with the word entered in the term. The ignoreErrors
(defaults to false) can be added to indicate whether a malformed regular expression will throw JS errors.strTerm
pattern(s). This function will either return an array of all of the matches (RegExp style) according to the pattern(s) or false
in the case that no match is found.