Tell us what’s happening:
What is /sno in the solution ?
Your code so far
let ohStr = "Ohhh no";
let ohRegex = /h{3,6}/; // Change this line
let result = ohRegex.test(ohStr);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/specify-upper-and-lower-number-of-matches
Maybe you mean \sno
?
\s
will match any whitespace charater (tabs, spaces etc)
no
will make just match the characters ‘no’
1 Like
Make characters “no” means ?
It matches the characters no literally (case sensitive).
1 Like
Can any character be matched by \character ?
Characters are just letters. Writing no will make it match no.
Okk, Thanks for helping, got pretty active and supporting community here.
No problem If you want to match any character you can write either [A-Za-z] or \w. \w will match numbers 0-9 and _ as well.
Here’s a good side to practise Regex, make sure you check EcmaScript in the Flavor list to the left.
1 Like
i need a bit of help here, I posted that 2 times in forum, but no one replied.
It will match the letter h 3-6 times.
Full match will be:
O
h 3-6 times
One space/tab
no
Ohhh no // match
Ohhhhhh no // match
Ohh no // no match
It even matches if h is more than 6 times
ilenia
12
Can you show an example of code in which more than 6 hs are matched?
It is solved. Problem was in my browser, It’s fixed.
Thanks ya’all for helping…