I am trying to find a regular expression that works to match a string of escape characters (Expect answer, see this question ) and a six-digit number (with alpha-numeric first character).
Here is the whole line I need to define:
\r\n\u001b[1;14HX76196
Ultimately, I need to extract the line:
X76196
Here is what I already have:
interact {
-nobuffer -re {^([a-zA-Z0-9]{1})?[0-9]{5}$} {
set number $interact_out(0,string)
}
I need to identify escape characters to verify that this field is in this area of the screen. So I need a regular expression that includes this first part, but the backslashes are confusing me ...
Also, as soon as I have a complete line in the variable $ number, how can I highlight only the number in another variable in Tcl?