Checks if value is classified as a RegExp object. Part of Lodash Lang (stable — not deprecated). Note: a string like "/abc/" is not a RegExp — official docs show _.isRegExp('/abc/') → false.
Pass the value you want to inspect or convert. Read the return type carefully before you use the result.
Syntax
Call _.isRegExp. Start with this line.
Lodash
_.isRegExp(value)
Call
What it does
_.isRegExp(value)
Primary signature.
Prefer import isRegexp from "lodash/isRegexp" when you want a smaller bundle.
Guard. Skip .test() unless the matcher is a RegExp.
Literal. Real regex matches "Ada".
String / null. Fail safely without throwing.
Why. Calling .test on a string would throw a TypeError.
Compatibility
Browser & Runtime Support
_.isRegExp is a Lodash Lang helper available in 4.x (and earlier builds). It runs anywhere Lodash runs — modern browsers (via CDN or bundle) and Node.js / Bun / Deno with npm install lodash. Native engines offer instanceof RegExp; Lodash uses tag-based classification for more consistent cross-realm checks.
✓ Stable · Lodash 4.x
_.isRegExp()
Available in [email protected] full builds and the lodash/isRegExp modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.
100%With Lodash 4.x
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
_.isRegExpLodash 4.x
Bottom line: Safe for production once Lodash is on the page or in your bundle. Prefer import isRegExp from "lodash/isRegExp" for smaller builds. Remember: '/abc/' is a string, not a RegExp.
Frequently Asked Questions
_.isRegExp(value) returns true when value is classified as a RegExp object — for example /abc/ or new RegExp('abc'). Look-alike strings return false.
That value is a string. Official Lodash docs show it as false. Compile it with new RegExp(...) or use a literal /abc/ if you need a real RegExp.
Usually aligned in one realm. Lodash uses internal tagging so classification stays consistent across environments where instanceof can fail (for example across iframes).
No. Only real RegExp instances matter — ordinary objects that mimic a regex shape still fail.
JSON does not serialize regex. API payloads usually send a string pattern you must compile yourself with new RegExp.
Use import isRegExp from "lodash/isRegExp" or require("lodash/isRegExp") so bundlers can tree-shake unused Lodash code. Full build: import _ from "lodash" then _.isRegExp.