AccelByte interview question

Explain the algorithm to check if string match in specific conditions!