Test, validate and match regular expressions
Matches a single letter followed by a digit, then a pipe character, followed by one or two id-name segments. Each segment optionally starts with a tilde (~), contains 'id' plus one or more digits, a hyphen, and 'name' plus digits. Commonly used for parsing structured identifiers or key-value records with optional negation markers and an optional repeated segment, e.g. 'A1|id123-name456~id7-name8'.