Sort by

recency

|

176 Discussions

|

  • + 0 comments

    let re = /^([aeiou]).*\1$/i

    this is for my case.

  • + 0 comments
     const re = new RegExp('^([aeiou]).*\\1$')
    
  • + 0 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.

  • + 0 comments

    quickest possible way ik

    function regexVar() {
        return /^([aeiou]).*\1$/;
    }
    
  • + 1 comment
    const re = /^a.*a$|^e.*e$|^i.*i$|^o.*o$|^u.*u$/;
    

    im sure there's a quicker way to do it