Ad
  • Default User Avatar

    Hi iphark. For this particular kata, research "lookahead assertion", "character set", and how the ^ (carat) and $ (dollar sign) work in regex. Hopefully this helped!

  • Default User Avatar

    I'm new to regex, but it seems that you don't allow for a reoccurrence of any letters or numbers.

    For example:
    "(?=.[a-z])" returns the first instance of any lowercase letter, but does not allow for duplicates.

    "(?=.*[a-z])" returns the first instance of any lowercase letter, but the asterisk symbol allows for 0 to infinite repititions.

    When I modified my code that passed all tests to remove the asterisk symbol so it look like yours, my test failed. Also, you should (from what I've read) place the "{6,}" after the "(?=.\d)" and add a "$" at the end to tell regex that the string is done (good habits to reduce errors when dealing with multiline comments if you ever do). Hopefully this helped!

  • Default User Avatar

    Received output "It should work for random inputs too: ['a', 5, -5, -2, 'x', -3, 'pippi', 0, 0] should equal ['a', 5, '0', -5, -2, 'x', -3, 'pippi', 0]".
    The answer from the kata does not move all 0's to the back.