RegExp.prototype[Symbol.search]()
RegExp.prototype[Symbol.search]() is a JavaScript method in the RegExp category. The Symbol.search method for String.search. The syntax is regexp[Symbol.search](str). A typical example: /l/[Symbol.search]("hello") // 2. A close sibling is RegExp.prototype.test(), which tests for a match in a string. A close sibling is RegExp.prototype.exec(), which executes a search for a match (with groups). A close sibling is RegExp.prototype.source, which returns the pattern text. A close sibling is RegExp.prototype.flags, which returns the flags as a string. More about this category: Regular expression methods for pattern matching. Related RegExp methods: RegExp.prototype.test(), RegExp.prototype.exec(), RegExp.prototype.source, RegExp.prototype.flags, RegExp.prototype.lastIndex, RegExp.prototype.global, RegExp.prototype.ignoreCase, RegExp.prototype.multiline. This page is part of the free JS Reference documentation covering 1027+ methods, each with syntax, parameters, return values, examples, and common pitfalls. You can try RegExp.prototype[Symbol.search]() immediately in the JavaScript playground, look up unfamiliar terms in the glossary, or return to the JS Reference homepage.