about summary refs log tree commit diff
path: root/src/libregex/re.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libregex/re.rs')
-rw-r--r--src/libregex/re.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libregex/re.rs b/src/libregex/re.rs
index 1b6dcb3a8e2..3171966a596 100644
--- a/src/libregex/re.rs
+++ b/src/libregex/re.rs
@@ -540,6 +540,7 @@ impl Regex {
 
 }
 
+#[deriving(Clone)]
 pub enum NamesIter<'a> {
     NamesIterNative(::std::slice::Iter<'a, Option<&'static str>>),
     NamesIterDynamic(::std::slice::Iter<'a, Option<String>>)
@@ -596,6 +597,7 @@ impl<F> Replacer for F where F: FnMut(&Captures) -> String {
 ///
 /// `'r` is the lifetime of the compiled expression and `'t` is the lifetime
 /// of the string being split.
+#[deriving(Clone)]
 pub struct RegexSplits<'r, 't> {
     finder: FindMatches<'r, 't>,
     last: uint,
@@ -629,6 +631,7 @@ impl<'r, 't> Iterator<&'t str> for RegexSplits<'r, 't> {
 ///
 /// `'r` is the lifetime of the compiled expression and `'t` is the lifetime
 /// of the string being split.
+#[deriving(Clone)]
 pub struct RegexSplitsN<'r, 't> {
     splits: RegexSplits<'r, 't>,
     cur: uint,
@@ -792,6 +795,7 @@ impl<'t> Captures<'t> {
 /// expression.
 ///
 /// `'t` is the lifetime of the matched text.
+#[deriving(Clone)]
 pub struct SubCaptures<'t> {
     idx: uint,
     caps: &'t Captures<'t>,
@@ -814,6 +818,7 @@ impl<'t> Iterator<&'t str> for SubCaptures<'t> {
 /// Positions are byte indices in terms of the original string matched.
 ///
 /// `'t` is the lifetime of the matched text.
+#[deriving(Clone)]
 pub struct SubCapturesPos<'t> {
     idx: uint,
     caps: &'t Captures<'t>,
@@ -837,6 +842,7 @@ impl<'t> Iterator<Option<(uint, uint)>> for SubCapturesPos<'t> {
 ///
 /// `'r` is the lifetime of the compiled expression and `'t` is the lifetime
 /// of the matched string.
+#[deriving(Clone)]
 pub struct FindCaptures<'r, 't> {
     re: &'r Regex,
     search: &'t str,
@@ -879,6 +885,7 @@ impl<'r, 't> Iterator<Captures<'t>> for FindCaptures<'r, 't> {
 ///
 /// `'r` is the lifetime of the compiled expression and `'t` is the lifetime
 /// of the matched string.
+#[deriving(Clone)]
 pub struct FindMatches<'r, 't> {
     re: &'r Regex,
     search: &'t str,