Can someone explain me how this regex works?

you can try to review this challenge:

you can also take a look at this explanation:

and this follow up: