We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
passes all the sample test provided because the sample test are all
3 letter strings but it should fail the
constraint: **'' The length of string s is >= 3" **
better regex: const re = /^([aeiou]).+\1$/;
the above regex checks for above constrain.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 7: Regular Expressions I
You are viewing a single comment's thread. Return to all comments →
my regex: const re = /^([aeiou])\w*\1$/;
passes all the sample test provided because the sample test are all 3 letter strings but it should fail the constraint: **'' The length of string s is >= 3" **
better regex: const re = /^([aeiou]).+\1$/;
the above regex checks for above constrain.