RegExp RegExp Object
Last updated: 2026-09-09
RegExp RegExp Object
RegExp is the regular expression object for pattern matching.
| Category | RegExp |
|---|---|
| ES version | ES1 |
📝 Syntax
const re = /pattern/flags;
▶ Example
Edit the code, press Run, and see the result in the output panel:
Output:
['123']
💡 Tip Regex literals are cleaner than constructors.
ℹ️ info g=global, i=case-insensitive, m=multiline.
🏷️ Related Items
💡 Related Cases
More case studies coming soon — check back later.
📚 Related Tutorials
❓ FAQ
QWhat does g flag mean?
AGlobal — find all matches.
QHow to match Chinese?
A/[\u4e00-\u9fff]/.
QRegex performance?
AAvoid nested quantifiers.