Skip to content

Commit a60737c

Browse files
committed
Fix a panic in the Python formatter
1 parent bdac1b4 commit a60737c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/python.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ lazy_static::lazy_static! {
1212
/// The regular expression used for parsing python format strings.
1313
static ref PYTHON_RE: Regex = Regex::new(r"(?x)
1414
%
15-
(?:\((?P<key>\w+)\))? # Mapping key
16-
(?P<flags>[\#|0|\-| |+]*)? # Conversion flags
17-
(?P<width>\*|\d+)? # Minimum field width
18-
(?:.(?P<precision>\*|\d+))? # Precision after decimal point
19-
[h|l|L]* # Ignored length modifier
20-
(?P<type>[d|i|o|u|x|X|e|E|f|F|g|G|c|r|s|%]) # Conversion type
15+
(?:\((?P<key>\w+)\))? # Mapping key
16+
(?P<flags>[\#0\- +]*)? # Conversion flags
17+
(?P<width>\*|\d+)? # Minimum field width
18+
(?:.(?P<precision>\*|\d+))? # Precision after decimal point
19+
[hlL]* # Ignored length modifier
20+
(?P<type>[diouxXeEfFgGcrs%]) # Conversion type
2121
").unwrap();
2222
}
2323

0 commit comments

Comments
 (0)