Hi I want to match only a part of a variable and store it. For example for the element b12asc34sx110 I want to match b12asc34s and store it in a variable and also store x110 in another variable. The value of the element keep changing, like it can be b12hdh56sx120 or b12hdgwa78x20. The code which I am trying is
set element b12asc34sx110
regexp [\(.*)\ {[^x(0-9]}] $element matched1
regexp [x(0-9)] $element matched2
puts $matched1
puts $matched2
The value of element will come from the user hence it may change everytim. I am new to regexp hence finding it difficult. I am not getting the output for it. Please help me with this.