How to exclude nodes without tag (learning how to create custom validation)

Hi all,

I’m exploring and would like to learn how to create custom validation rules.
Currently, I am practicing with creating a validation rule that checks for non matching crossing=* tags between node and way.

Here is my current code. It gets the job done so far. However, it is also flagging nodes that have no tags. How can I exclude nodes that have no tags in this code?

way[crossing =~ /^(unmarked|controlled|)$/] > node{ set .is_crossing_marked }
node[crossing!=unmarked][crossing!=controlled].is_crossing_marked{
throwError: tr("Node does not match crosswalk crossing tag ");
group: tr(“non matching crossing tag”);
}

Any help is greatly appreciated, thanks!

test to add “:tagged” to node second line

way[crossing =~ /^(unmarked|controlled|)$/] > node{ set .is_crossing_marked }
node:tagged[crossing!=unmarked][crossing!=controlled].is_crossing_marked{
throwError: tr("Node does not match crosswalk crossing tag ");
group: tr(“non matching crossing tag”);
}