Skip to content

Commit 442213e

Browse files
committed
consecutive('.')
1 parent 2bb1e17 commit 442213e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

mug/src/main/java/com/google/mu/util/Substring.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,16 @@ public static Pattern trailing(CharPredicate matcher) {
660660
};
661661
}
662662

663+
/**
664+
* Returns a {@code Pattern} that matches the first non-empty sequence of consecutive {@code ch}
665+
* characters.
666+
*
667+
* @since 8.7
668+
*/
669+
public static Pattern consecutive(char ch) {
670+
return consecutive(CharPredicate.is(ch));
671+
}
672+
663673
/**
664674
* Returns a {@code Pattern} that matches the first non-empty sequence of consecutive characters
665675
* identified by {@code matcher}.

0 commit comments

Comments
 (0)