YouTube Link: https://youtu.be/B5iF6XBpcsI
** Full Stack Web Developer Masters Program: https://www.edureka.co/masters-program/full-stack-developer-training **
This Edureka PPT on "JavaScript Regex" will help you understand regular expression in JavaScript and how they are used to perform pattern matching in any string.
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
4. A Regular Expression is a sequence of characters that constructs a search pattern. When you search for data in a text,
you can use this search pattern to describe what you are looking for.
What are Regular Expressions?
www.edureka.co
8. [abc] Finds any character between the brackets
[^abc] Finds any character NOT between the brackets
[0-9] Finds any digit between the brackets
[^0-9] Finds any non-digit NOT between the brackets
www.edureka.co
10. w It looks for a word character
W It finds a non-word character
d It finds a digit
D It finds a non-digit Character
s It finds a whitespace character
S It finds a non-whitespace character
b It finds a match at the beginning/end of a word
B It looks for a match, but not at the beginning/end of a word
f It finds a form feed character
r It finds a carriage return character
v It finds a vertical tab character
t It finds a tab character
www.edureka.co
12. n+ It matches any string that contains at least one n
n* It matches any string that contains zero or more occurrences of n
n? It matches any string that contains zero or one occurrence of n
n{X} It matches any string that contains a sequence of X n’s
n{X,Y} It matches any string that contains a sequence of X to Y n’s
n{X,} It matches any string that contains a sequence of at least X n’s
n$ It matches any string with n at the end of it
www.edureka.co
14. Constructor Returns the function that creates the RegExp object’s prototype
global Checks whether the “g” modifier is set
ignoreCase Checks whether the “i” modifier is set
lastIndex Specifies the index at which to start the next match
multiline Checks whether the “m” modifier is set
www.edureka.co
16. Compile() It compiles a regular expression
exec() It tests for a match in a string and returns the first match
test() It tests for a match in a string and returns true or false
toString() It returns the string value of the regular expression
www.edureka.co