I get what you are trying to do but unfortunately it’s a far cry from how regex works.
You shouldn’t need regex to solve this challenge. I imagine some looping should suffice.
PS You can potentially solve this challenge using regex but you’ll need to use the regex constructor function and it’s still going to be an overcomplication i.e. not the best choice. And if you don’t know what I’m talking about then ignore this last bit of comment.