Anyone any good at regular expressions? Not entirely off topic, I've been fiddling about with syntax highlighting for the TL/1 language (Fluke 9100).
Most of it is easy enough and just taking time but I wanted to pick up on illegal hex entry since hex numbers have to be in the form 0xFF(etc) and the letters must be upper case.
I'm new to regular expressions so I've been trying for a day now and I can't work out for the life of me how to detect lower case letters anywhere in the 'word'. I thought something like:
would be along the right lines, but the problem is that as soon as you have a valid upper case letter anywhere in the string it thinks it's valid. So, 0xffFf returns valid.
Anyone good enough to help with this please?
The other thing is that I want to restrict it to 8 characters (32bit) as well but I won't loose any sleep if I don't get that working.
Has to be regular expressions unfortunately too.
Most of it is easy enough and just taking time but I wanted to pick up on illegal hex entry since hex numbers have to be in the form 0xFF(etc) and the letters must be upper case.
I'm new to regular expressions so I've been trying for a day now and I can't work out for the life of me how to detect lower case letters anywhere in the 'word'. I thought something like:
Code:
b0x[^0-9A-F]+b
Anyone good enough to help with this please?
The other thing is that I want to restrict it to 8 characters (32bit) as well but I won't loose any sleep if I don't get that working.
Has to be regular expressions unfortunately too.