in reply to regex is not working as I intended

Unless I missed something, I don't see why you need to use look ahead and look behind assertions and the like here.

It seems to me that this should work correctly (but can't test now on my mobile device):

my $regex = qr / "([^"]+)" | '([^']+)' | (.+) /x;