Skip to content

Commit 9518fcb

Browse files
committed
Document that the pattern attribute accepts a string or a compiled regex
1 parent 21fd115 commit 9518fcb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Doc/library/string.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,8 @@ attributes:
971971

972972
Alternatively, you can provide the entire regular expression pattern by
973973
overriding the class attribute *pattern*. If you do this, the value must be a
974-
regular expression object with four named capturing groups. The capturing
974+
string containing the regular expression, or a compiled regular expression
975+
object, with four named capturing groups. The capturing
975976
groups correspond to the rules given above, along with the invalid placeholder
976977
rule:
977978

0 commit comments

Comments
 (0)