MatchesPathItem🔗

Type: Pattern verification
Check that text is a valid idShortPath.
An idShortPath is a chain of idShorts or SubmodelElementList-indexes which points to an element within a hierarchy of elements, e.g. , sme1.sme2[0].p1.

Code

pattern = (
    r"^(([A-Za-z][A-Za-z0-9_]+)|(\[[0-9]+\]))"
    r"((\.[A-Za-z][A-Za-z0-9_]+)|(\[[0-9]+\])){0,}$"
)

return match(pattern, text) is not None