Match against a string and return results.
Section: JavaScript Regex APIs
String.match()
javascript
javascript
text.match(/\b\w+\b/g)Explanation
With `g`, returns all matches; without `g`, returns the first detailed match.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing JavaScript Regex APIs