Doesn't node label support special character?

For example:

MATCH (a:t-code {id:'8d994a8861c6ca6bf0d0dede5c862bd3'})
MATCH (b:connections {id:'03817a80b08e323fb66b80e5ccc2f0d4'})
CALL apoc.merge.relationship(a, 'uses', {}, {}, b)
YIELD rel
RETURN rel;

It reports an error in 'a:t-code'. In practical graph, this support is desirable. I just want to confirm whether this is not supported, or I did something wrong. Similarly, the node type could contain characters, like '/'.

@lingvisa

though the Neo4j version has not been provided, v5 states

The - (dash) and . (dot) characters are not legal in Cypher variables. 
Names with a - in them must be enclosed within backticks. For example,
 CREATE DATABASE `main-db` is a valid database name. Database names
 are the only identifier for which dots do not need to be escaped. For
 example main.db is a valid database name. However, this behavior 
is deprecated due to the difficulty of determining if a dot is part
 of the database name or a delimiter for a database alias in 
a composite database.

Hi, @dana_canzano I am using the almost latest version. So I should write this form:

MATCH (a:'t-code' {id:'8d994a8861c6ca6bf0d0dede5c862bd3'})
MATCH (b:'connections' {id:'03817a80b08e323fb66b80e5ccc2f0d4'})

Is this right? My cypher are generated by code.

Backticks, not single quotes

` is a backtick
' is a single quote

Thanks @john.stegeman for the correction.

Because I can't expect what label strings (open information extraction) may contain those special characters, so when creating those cyphers, it's good to consistently use backtick to enclose any node label. Does that make sense?

My commonsense view says you should sanitize any external content that you are using to create labels. Otherwise, you are exposed to injection attacks.

Yes. I have a cleanup function to normalize some characters.