JavaScript RegExp + quantifier
The JavaScript RegExp object
Definition and Usage
nThe + quantifier matches a string containing at least one n .
Syntax
new RegExp("
n
+")
Or a simpler way:
/
n
+/
Browser support





All major browsers support the + quantifier.
Example
Example 1
Perform a global search for at least one "o":
var
str
=
"
Hellooo World! Hello Runoob!
"
;
var
patt1
=/
o
+/
g
;
The text marked below shows where the expression found matches:
Hell
ooo
W
o
rld! Hell
o
Run
oo
b!
Try it »
Example 2
Perform a global search for at least one word character:
var
str
=
"
Hellooo World! Hello Runoob!
"
;
var
patt1
=/\
w
+/
g
;
The text marked below shows where the expression found matches:
Hellooo World
!
Hello Runoob
!
Try it »
The JavaScript RegExp object