Last active
August 18, 2018 03:15
-
-
Save zsytssk/a60b1d89d9b534f18241fc62c7653147 to your computer and use it in GitHub Desktop.
regex match all
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const text = `TypeScript lets you write JavaScript the way you really want to. | |
TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. | |
ANY browser. ANY host. ANY OS. Open Source. | |
`; | |
const pattern = /\b[A-Z]{2,}\b/g; | |
let m; | |
while (m = pattern.exec(text)) { | |
console.log(m) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment