Created
July 30, 2020 05:45
-
-
Save tofusoup429/70d275a436f13c3093a8c6f774172c6f to your computer and use it in GitHub Desktop.
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
//extract more information for substring that matches exampleString. | |
const regexPattern=/\s+[0-9]+-[0-9]+-[0-9]+\s+/; | |
const exampleString = | |
"Hi~ call me this number 093-5353-6234 after" + | |
" 4:30 pm or email me at tofusoup429@gmail.com anytime."; | |
const result2 = regexPattern.exec(exampleString); | |
console.log("output: ",result2); | |
/*output: [ | |
' 093-5353-6234 ', | |
index: 23, | |
input: 'Hi~ call me this number 093-5353-6234 after 4:30 pm or email me at tofusoup429@gmail.com anytime.', | |
groups: undefined | |
]*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment