var regex = /^[A-za-z0-9]+[:[A-Za-z0-9.]+]|[^$]$/;
this has three issues:
- A-z includes []^_`
(should be A-Z)
- [:[A-Za-z0-9.]+] is a character class not a group
- |[^$]$ matches any string ending in non-$ char, so basically everything
Creating a node with label !!! or <script>, passes fine
Should probably be /^[A-Za-z0-9]+(:[A-Za-z0-9.]+)?$/ but honestly depends on what the actual label format is supposed to be. Current regex validates nothin