We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3988431 commit 3f4bfa6Copy full SHA for 3f4bfa6
regex-syntax/src/hir/mod.rs
@@ -1739,6 +1739,19 @@ pub struct Repetition {
1739
pub sub: Box<Hir>,
1740
}
1741
1742
+impl Repetition {
1743
+ /// Returns a new repetition with the same `min`, `max` and `greedy`
1744
+ /// values, but with its sub-expression replaced with the one given.
1745
+ pub fn with(&self, sub: Hir) -> Repetition {
1746
+ Repetition {
1747
+ min: self.min,
1748
+ max: self.max,
1749
+ greedy: self.greedy,
1750
+ sub: Box::new(sub),
1751
+ }
1752
1753
+}
1754
+
1755
/// A type describing the different flavors of `.`.
1756
///
1757
/// This type is meant to be used with [`Hir::dot`], which is a convenience
0 commit comments