+ 3
How to alert a regex match.
Guys, I have a question. How do you make a code to output a RegEx value. Like, when you have a RegEx that checks for some values, how do you make it alert the value that matched the RegEx. For example, if I have a RegEx that checks if a word has vowels, how do I make it alert the vowel it found im the word (like alerting "e" if the word is "then")
2 Answers
+ 2
use String.match() it'll return the found match as an array.
"then".match(/e/g);
+ 1
Thanks Taste . It worked
https://code.sololearn.com/WwbaHDuru10N/?ref=app