MatchesXsFloat🔗
Check that
text
conforms to the pattern of an xs:float
.
Code
floatRep = (
'((\\+|-)?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)([Ee](\\+|-)?[0-9]+)?|-?INF|NaN)'
)
pattern = (
f'^{floatRep}$'
)
return match(
pattern,
text
) is not None