Do a global search for at least one "o":
let text = "Hellooo World! Hello 91xjr!";
let pattern = /o+/g;
Try it Yourself »
The n+ quantifier matches any string that contains at least one n.
Do a global search for at least one word character:
let text = "Hellooo World! Hello 91xjr!";
let pattern = /\w+/g;
Try it Yourself »
/n+/
is an ECMAScript1 (ES1) feature.
ES1 (JavaScript 1997) is fully supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | Yes |
new RegExp("
n+")
or simply:
/
n+/
new RegExp("
n+", "g")
or simply:
/
n+/g
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!