HTML IDs can contain:
A-Z or a-z and may be followed by letters (A-Za-z), digits (0-9), hyphens ("-"), underscores ("_"), colons (":"), and periods (".")
(http://htmlhelp.com/reference/html40/attrs.html -- Unfortunately, I couldn't find a similar statement on w3c.)
I've been using semicolons in my IDs for a while now and never had any problems, even in CSS files (though they need to be escaped). However, they break the selector class because of:
expr.match(/([a-z0-9_-])?([a-z0-9_-]+)(.*)/i)
I recommend
expr.match(/([a-z0-9_-])?([a-z0-9:_-]+)(.*)/i)
(note the semicolon after the 9.)