Do we care about performance here? Because now it does 4 strpos searches on the whole pattern. It could iterate through pattern characters and just perform 4 comparisons. Probably this would require a benchmark, this is micro optimization.