9
Oh, I forgot. You need the "s" modifier if you want "." to match newlines:
preg_match('/^foobar3.+foobar6$/s', ...)
Are you sure you want the "^" and "$" anchors? This pattern wouldn't match the text you posted above, since it starts with foobar1, not foobar3; and ends with foobar10, not foobar6.