Regex Flashcards
1
Q
Using a basic Regex command write a variable named matches with a input of “hello” and print out he.
A
matches = “hello”.match(/h./)
2
Q
With the word hello how would replace the last letter with a y?
A
“hello”.replace(/o/, “y”)