4242gen_delims = r"(?: : | / | \? | \# | \[ | \] | @ )"
4343
4444# sub-delims = "!" / "$" / "&" / "'" / "("
45- sub_delims = r"(?: ! | \$ | & | ' | \( | \) | \* | \+ | , | ; | = )"
45+ sub_delims = r"(?: ! | \$ | & | ' | \( | \) | \* | \+ | , | ; | = )"
4646
4747# pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
4848pchar = rf"(?: { unreserved } | { pct_encoded } | { sub_delims } | : | @ )"
295295# As of now this module doesn't support NCNameChar IRI, but
296296# relative-refs as defined in URI,
297297# NCNameChar ::= Letter | Digit | '.' | '-' | '_'
298- NCNameChar = rf"(?: { ALPHA } | { DIGIT } | \. | \- | _ )"
298+ NCNameChar = rf"(?: { ALPHA } | { DIGIT } | \. | \- | _ )"
299299
300300# prefix := NCName
301301# NCName := (Letter | '_') (NCNameChar)*
324324#
325325### Compile the regular expressions for better performance
326326
327- uri_validator = re .compile ("^{}$" . format ( URI ) , re .VERBOSE )
327+ uri_validator = re .compile (f "^{ URI } $" , re .VERBOSE )
328328
329- #uri_ref_validator = re.compile("^{}$".format(URI_reference) , re.VERBOSE)
329+ #uri_ref_validator = re.compile(f "^{URI_reference }$", re.VERBOSE)
330330
331- uri_relative_ref_validator = re .compile ("^{}$" . format ( relative_ref ) , re .VERBOSE )
331+ uri_relative_ref_validator = re .compile (f "^{ relative_ref } $" , re .VERBOSE )
332332
333- abs_uri_validator = re .compile ("^{}$" . format ( absolute_URI ) , re .VERBOSE )
333+ abs_uri_validator = re .compile (f "^{ absolute_URI } $" , re .VERBOSE )
334334
335- curie_validator = re .compile ("^{}$" . format ( CURIE ) , re .VERBOSE )
335+ curie_validator = re .compile (f "^{ CURIE } $" , re .VERBOSE )
336336
337- safe_curie_validator = re .compile ("^{}$" . format ( safe_CURIE ) , re .VERBOSE )
337+ safe_curie_validator = re .compile (f "^{ safe_CURIE } $" , re .VERBOSE )
338338
339339# -----------------------------------------------------------------------------
340340#
@@ -357,6 +357,5 @@ def validate_uri_reference(input):
357357
358358
359359def validate_curie (input ):
360- # print(CURIE)
361360 return curie_validator .match (input )
362361
0 commit comments