icalendar.parser.string module#

Functions for manipulating strings and bytes.

Removed in version 8.0.0: Removed escape_char, escape_string, foldline, unescape_char, unescape_string.

icalendar.parser.string.validate_token(name)[source]#

Validate that a name is a valid iCalendar token.

Checks if the name matches the RFC 5545 token syntax using the NAME regex pattern ([\w.-]+).

Parameters:

name (str) – The token name to validate.

Raises:

ValueError – If the name is not a valid token.

Return type:

None