🔥Limited Offer: Get 50% OFFon AI & Full Stack Courses🔥
Back to JavaScript Notes
Topic #92

JS RegExp Methods


Complete RexExp Reference

Revised July 2025

Col 1 Col 2
Name Description
compile() Compiles a regular expression (Deprecated)
constructor Returns the function that created the RegExp prototype
dotAll Returns true if the s flag is set in the expression (new in 2018)
escape() Returns a string where characters that belongs to the regular expression syntax are escaped (new in 2025)
exec() Returns a result array for a matches in a string
flags Returns the modifiers set in the expression (new in 2015)
global Returns true if the g flag is set in the expression
hasIndices Returns true if the d flag is set (new in 2022)
ignoreCase Returns true if the i flag is set
lastIndex Specifies the index at which to start the next match
multiline Returns true if the m modifier is set
source Returns the text of the RegExp pattern
sticky Returns true if the y flag is set (new in 2015)
test() Tests for a match in a string. Returns true or false
toString() Returns the string value of the regular expression
unicode Returns true if the u flag is set (new in 2018)
unicodeSets Returns true if the v flag is set (new in 2023)

RegExp String Methods

Col 1 Col 2
Method Description
match(regexp) Returns an Array of results
matchAll(regexp) Returns an Iterator of results
replace(regexp, s) Returns a new String
replaceAll(regexp, s) Returns a new String
search(regexp) Returns the index of the first match
split(regexp) Returns an Array of results

Note: See Also: JavaScript RegExp Tutorial JavaScript RegExp Flags JavaScript RegExp Character Classes JavaScript RegExp Meta Characters JavaScript RegExp Assertions JavaScript RegExp Groups JavaScript RegExp Quantifiers JavaScript RegExp Patterns JavaScript RegExp Objects

Want to go beyond the notes?

Join CodingNow 2.0's JavaScript course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

JS RegExp Methods – FAQs

Quick answers about learning JS RegExp Methods in JavaScript.

This free note from CodingNow 2.0 explains JS RegExp Methods in JavaScript — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every JavaScript topic on CodingNow 2.0, including JS RegExp Methods, is 100% free with no signup required.
With focused practice, most students grasp JS RegExp Methods in 1–3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) — expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now