I'm trying some regex. However, it isn't matching correctly.
I'm just using the regex:
preg_match('/^(.+).*\1/', $string, $match, NULL, $i)
With $i incrementing from 0 to strlen($string). This is used to find the longest string inside $string that repeats.
However, when dealing with VERY long strings (tested 100,000 characters), it fails.
NOTHING matches.
I am 100% sure that there are matches, expecially considering if there are 100,000 characters, and its looking for at a minimum, 2 characters that match, it should find SOMETHING.
Anyone have any ideas?
Note: I have tried with different FLAGS than "NULL", others tried were: PREG_OFFSET_CAPTURE, etc...