Skip to content

Commit c81b481

Browse files
chancyWuchancywu
authored and
chancywu
committed
fix: PatternSyntaxException in Android
Signed-off-by: chancywu <[email protected]>
1 parent f600e6c commit c81b481

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/casbin/jcasbin/util/BuiltInFunctions.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
public class BuiltInFunctions {
3434

3535
private static Pattern keyMatch2Pattern = Pattern.compile("(.*):[^/]+(.*)");
36-
private static Pattern keyMatch3Pattern = Pattern.compile("(.*)\\{[^/]+}(.*)");
36+
private static Pattern keyMatch3Pattern = Pattern.compile("(.*)\\{[^/]+\\}(.*)");
3737

3838
/**
3939
* keyMatch determines whether key1 matches the pattern of key2 (similar to RESTful path), key2
@@ -119,7 +119,7 @@ public static boolean keyMatch3(String key1, String key2) {
119119
* @return whether key1 matches key2.
120120
*/
121121
public static boolean keyMatch4(String key1, String key2) {
122-
String regEx = "\\{[^/]+}";
122+
String regEx = "\\{[^/]+\\}";
123123
Pattern p = Pattern.compile(regEx);
124124
Matcher m = p.matcher(key2);
125125

0 commit comments

Comments
 (0)