scala/scala — pull request #1369 by som-snytt (2012-09-21 01:01:26+00:00)
Title: Regex.unapplySeq should not take Any (Fixes SI-6406)

This deprecates unapplySeq(Any) and adds overloaded
unapplySeq(CharSequence) and unapplySeq(Match), with the
putative advantage that you can't try to extract the unextractable.

Regex is massaged so that the underlying Pattern is primary,
rather than the String-valued expression. Regex and its
unanchored companion (I almost wrote unmoored) share a
Pattern object, so that unapplySeq(Match) can easily test
whether the Match was generated by this Regex; in that case,
the match result is used immediately, instead of reapplying
the regex to the matched string.

The documentation is massaged to reflect unanchored and also to
align with the underlying terminology, e.g., "subgroup" really
just means "group."

Review by @jsuereth