summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/library/scala/util/matching/Regex.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/library/scala/util/matching/Regex.scala b/src/library/scala/util/matching/Regex.scala
index 67d37083e8..92e4c2713c 100644
--- a/src/library/scala/util/matching/Regex.scala
+++ b/src/library/scala/util/matching/Regex.scala
@@ -114,6 +114,16 @@ class Regex(regex: String, groupNames: String*) {
m.replaceFirst(replacement)
}
+ /** Splits the provided character sequence around matches of this
+ * regexp.
+ *
+ * @param toSplit The character sequence to split
+ * @return The array of strings computed by splitting the
+ * input around matches of this regexp
+ */
+ def split(toSplit: java.lang.CharSequence): Array[String] =
+ pattern.split(toSplit)
+
/** The string defining the regular expression */
override def toString = regex
}