Last active
March 1, 2020 06:30
-
-
Save acezalba/eb4fbe9aeec2cd1a7ac1f26d78f0251c to your computer and use it in GitHub Desktop.
Regex Lazy Matching Template #fcc #js #regex
This file contains hidden or 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
| let text = "<h1>Winter is coming</h1>"; | |
| let myRegex = /<.*?>/; // Change this line | |
| let result = text.match(myRegex); | |
| // + is greedy | |
| // ? is lazy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment