Tests for capturing to constrained variables

I'm not sure how often people will do things like this, but I want to
make sure it continues to work correctly.  A DCG is typically used for
these use cases, but there may be circumstances where a regex is
preferred for various reasons.