File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
dot-parse/src/main/java/com/google/common/labs/parse Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 44import static com .google .mu .util .CharPredicate .isNot ;
55import static com .google .mu .util .Substring .after ;
66import static com .google .mu .util .Substring .prefix ;
7- import static com .google .mu .util .Substring .suffix ;
87import static java .util .stream .Collectors .reducing ;
98
109import com .google .mu .util .CharPredicate ;
11- import com .google .mu .util .Substring ;
1210
1311/**
1412 * Represents a set of characters specified by a regex-like character set string.
@@ -66,9 +64,11 @@ public boolean contains(char ch) {
6664 }
6765
6866 @ Override public CharacterSet not () {
69- String content = Substring .between (prefix ("[" ), suffix ("]" )).from (string ).get ();
7067 return new CharacterSet (
71- "[" + after (prefix ("^" )).from (content ).orElseGet (() -> "^" + content ) + "]" ,
68+ after (prefix ("[" ))
69+ .in (string )
70+ .map (m -> m .startsWith ("^" ) ? "[" + m .skip (1 , 0 ) : "[^" + m )
71+ .orElse (string ),
7272 predicate .not ());
7373 }
7474
You can’t perform that action at this time.
0 commit comments