DEV Community

Discussion on: Coding Puzzles: Week of 4/8

 
threeheadedcerb profile image
russ • Edited

You should be able to simplify it a little by changing the + to a * so you don't need the second \D I think?
(\D)\1*|(\d+)

Thread Thread
 
laurieontech profile image
Laurie

Ooh, you're right. I had it that way to start and then ran into problems with a test case that had 663. It was splitting that grouping because it hit the matching case first. But when I removed the capture group generic and made it non-digit that solved that. So can revert back. Thanks :)