No, this is not a replicate of The ':' character, hexadecimal value 0x3A, cannot be included in a name
I have a Regex for my syntax highlighter for my scripting language:
`@"\bClass+(?<range>\w+?)\b"`
which basically marks Class Name
(with the engine I got online)
I’m no master in Regex but for some reason the : character that uses my language to create labels – doesn’t work.
I tried
@"\b:+(?<range>\w+?)\b"`, `@"\b\:+(?<range>\w+?)\b"`<RB> `@"\b(\x3A)+(?<range>\w+?)\b"
And it refuses to work!
Any ideas?
I suspect the issue in your case is not the
:itself, but the\bbefore it.\bmarks the boundary between a word character and nonword character, but whileClassis comprised of word characters,:is a nonword character. So\bis behaving differently for:than it would forClass, so:If you use your original expression but replace the first
\bwith(?<!\w), it may identify the:properly.