Skip to content

Commit

Permalink
remove : from allowed chars
Browse files Browse the repository at this point in the history
  • Loading branch information
gschueler committed May 24, 2021
1 parent 544e16b commit b89a08c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static String format(String format, DataOutput data, final String start,
}

public static String format(String format, Map<?, ?> data, final String start, final String end) {
Pattern pat = Pattern.compile(Pattern.quote(start) + "([\\w.:_-]+)" + Pattern.quote(end));
Pattern pat = Pattern.compile(Pattern.quote(start) + "([\\w._-]+)" + Pattern.quote(end));
Matcher matcher = pat.matcher(format);
StringBuffer sb = new StringBuffer();
while (matcher.find()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class FormatSpec extends Specification {
'%' | '' | 'a %b %c' | [b: '\\x'] | 'a \\x '
'%' | '' | 'a %b-x q' | ['b-x': 'z'] | 'a z q'
'%' | '' | 'a %b_x r' | ['b_x': 'z'] | 'a z r'
'%' | '' | 'a %b:x r' | ['b:x': 'z'] | 'a z r'

}

Expand All @@ -58,7 +57,6 @@ class FormatSpec extends Specification {
'%' | '' | '%a.b b c' | [a: 'x', b: [c: 'd']] | ' b c'
'%' | '' | '%b.c-d q r' | [a: 'x', b: ['c-d': 'e']] | 'e q r'
'%' | '' | '%b.c_d q r' | [a: 'x', b: ['c_d': 'e']] | 'e q r'
'%' | '' | '%b.c:d q r' | [a: 'x', b: ['c:d': 'e']] | 'e q r'

}
}

0 comments on commit b89a08c

Please sign in to comment.