Tokopedia interview question

Conditional if else using Regex, but regex cannot be more that 25 character long