Is it possible? Yes. Is it reasonable? Probably not.
Here is a demo in Perl, just to show it can be done with your particular example:
#!/usr/bin/perl -l
my $string = "abcd";
my $pattern = qr{
^
(?= ( .{1} ) )
(?= ( .{2} ) )
(?= ( .{3} ) )
(?= ( .{4} ) )
}x;
my @captures = ($string =~ $pattern);
print for @captures;
Which when run produces this output:
a
ab
abc
abcd
The PCRE library that PHP uses is perfectly capable of doing that. But not even I would do it that way.
And as for arbitrary groupings, that becomes even trickier still, requiring a recursive pattern and even more serious magic. I wouldn’t do that for anything but some sort of extenence-proof sort of programming contest, not for real code that you would hope to maintain, and not get shot for.