Match Numbers and Letters of the Alphabet

Match Numbers and Letters of the Alphabet
0

#1

Tell us what’s happening:
solved

Your code so far


let quoteSample = "Blueberry 3.141592653s are delicious.";
let myRegex = /[h-s2-6]/ig; // Change this line
let result = quoteSample.match(myRegex); // Change this line

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/match-numbers-and-letters-of-the-alphabet


#2

for some reason this wasnt working… mmm thanks your solution helped, and i figured out it’s because i forgot to apply [] doh!


let quoteSample = "Blueberry 3.141592653s are delicious.";
let myRegex = /h-s2-6/gi; // Change this line
let result = quoteSample.match(myRegex); // Change this line

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3523.0 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/match-numbers-and-letters-of-the-alphabet


#3

Actually,you should add “[]” between / / <-- these. Hope that works


#4

Yup that’s what i said :slight_smile:


#5