scala/scala — pull request #100 by LannyRipple (2011-10-11 16:43:36+00:00)
Title: SI-5045 implement a Regex that is not implicitly anchored in pattern matc

SI-5045 implement a Regex that is not implicitly anchored in pattern matching

Implementation follows advice received in the JIRA to retain current behavior by default. Have added behavior

```
isAnchored: Boolean
anchor(): Regex // return Regex that implicitly anchors in pattern match
unanchor(): Regex // return Regex that does not implicitly anchor in pattern match
```

Motivating usage:

```scala
val Date = """(\d{4}-\d\d-\d\d)""".r.unanchor
val copyright = "copyright 2011-09-29" match {
case Date(when) => Right(when)
case _ => Left("No date matched.")
}
```