cmd/go: account for flags when parsing regexps in TestScript
cmd/go: account for flags when parsing regexps in TestScript

Test script expects the regexp argument for stdout, stderr, and cmp
to be the first argument after the command, but that might not be the
case if the -q or -count flags are provided. Treat the first argument
after a flag as a regexp instead.

For #39958

Change-Id: I369926109ec10cca8b2c3baca27e7a3f7baf364b
Reviewed-on: https://go-review.googlesource.com/c/go/+/267877
Trust: Michael Matloob <4562438b12c14e81a47550acde616ff328a909f8@golang.org>
Run-TryBot: Michael Matloob <4562438b12c14e81a47550acde616ff328a909f8@golang.org>
TryBot-Result: Go Bot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Bryan C. Mills <1c8aad60184261ccede67f5c63a0d2a3bf3c9ff4@google.com>

nawawi/go,CAFxX/go,golang/go,CAFxX/go,cloudflare/go,cloudflare/go,golang/go,nawawi/go,CAFxX/go,cloudflare/go,golang/go,golang/go,golang/go,cloudflare/go,cloudflare/go,nawawi/go,CAFxX/go,CAFxX/go,nawawi/go,golang/go,golang/go,CAFxX/go,cloudflare/go,cloudflare/go,CAFxX/go,cloudflare/go,nawawi/go,nawawi/go,CAFxX/go,nawawi/go,nawawi/go,golang/go