summaryrefslogtreecommitdiff
path: root/test/files/run/t6406-regextract.scala
Commit message (Collapse)AuthorAgeFilesLines
* Regex.unapplySeq should not take Any (Fixes SI-6406)Som Snytt2012-09-201-0/+30
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."