Meta interview question

Regx implementation