I am new to regular expressions and tcl and am facing very basic issue from a long time now.
I am given with the task to find all the characters in given word, whose immediate next character is not identical to this character. I have written following tcl snippet to achieve this:
set str "goooo";
set lst [regexp -all -inline {(\w)[^\1]} $str];
puts $lst
I am getting following error:
couldn't compile regular expression pattern: invalid escape \ sequence
while executing
"regexp -all -inline {(\w)[^ \1]} $str"
Is there any other way to use backreferencing in tcl?