PHP preg_match - 非贪婪匹配的最大数量

Is there a known limit of how many times I am allowed to use the non-greedy .*? match in a regular expression in PHP?

My haystack is ~ 200k characters and I have to find out, whether 75 Numbers are in the correct order. I know there are better ways to do this without using preg_match, but for the sake of this question, stay with me.

  • My first regular expression looked like @123.*?456.*?789.*?101112@ etc. with 75 numbers - it failed.

  • Second approach: Split after the first 30 numbers, so we have two regular expressions like the one above, the first one having 30 and the second one 45 numbers. The second one failed.

  • Third approach: Split after the first 40 numbers (So there are 40 and 35 numbers). Both succeeded.

I've made sure that number 39 and 40 are in order, so my guess is, that there are some limitations to preg_match.

Check by increasing this value

ini_set("pcre.backtrack_limit", "1000000");