first, this is using preg.
String I'm trying to match:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa b c d xp
My regex and their matches:
(\S*\s*){0,1}\S*p = "d xp"
(\S*\s*){0,2}\S*p = "c d xp"
(\S*\s*){0,3}\S*p = NO MATCH (expecting "b c d xp"
(\S*\s*){0,4}\S*p = entire string
(\S*\s*){0,5}\S*p = entire string
Oddly, if I remove a single "a" it works. Also, (\S*\s*){0,3}\Sp
or (\S*\s){0,3}\S*p
both work.
Can someone explain why the third case results in no matches instead of "b c d xp"?
TIA!