Skip to content

Commit 417a91a

Browse files
committed
Use raw strings in regex expressions
1 parent d3f2252 commit 417a91a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

ckanext/dcat/validators.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ def scheming_validator(func):
1919

2020
# https://www.w3.org/TR/xmlschema11-2/#gYear
2121
regexp_xsd_year = re.compile(
22-
"-?([1-9][0-9]{3,}|0[0-9]{3})(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?"
22+
r"-?([1-9][0-9]{3,}|0[0-9]{3})(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?"
2323
)
2424

2525
# https://www.w3.org/TR/xmlschema11-2/#gYearMonth
2626
regexp_xsd_year_month = re.compile(
27-
"-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?"
27+
r"-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?"
2828
)
2929

3030
regexp_xsd_date = re.compile(
31-
"-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?"
31+
r"-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?"
3232
)
3333

3434

0 commit comments

Comments
 (0)