Hello!
I’m trying to create syntax highlighting for the language Inform III (used to program Yaskawa Motoman industrial robots). So far I’m happy with what I’ve come up with but now I want to do a thing I can’t figure out how to do.
Here’s an example of a simple Inform III program:
/JOB
//NAME Test
//POS
///NPOS 0,0,0,0,0,0
//ALIAS
///LVARS 1,0,0,0,0,0,0,0
LB000 byteVariableName
//INST
///DATE 2015/11/25 13:37
///ATTR SC,RO
///GROUP1 RB1
///LVARS 1,0,0,0,0,0,0,0
NOP
'--------------------------------
SET byteVariableName 0
INC byteVariableName
'--------------------------------
END
At the moment I’m succesfully matching the first occurence of byteVariableName with this:
(?<=([0-9]{4} ))\w+|(?<=([LBIDRSPCE][0-9]{3} ))\w+
(the name can be preceeded with either a 4-digit number or at least one of those letters followed by a 3-digit number)
What I want to do is have a separate regex that will find every other occurence of byteVariabelName, and I can’t figure out how to do that, what I’ve tried so far haven’t even come close.
//Stefan