Posted to tcl by dandyn at Thu Oct 03 16:15:19 GMT 2024view raw

  1. set dirty {BILLY BUTT: Hi there fellow TCL coders. Test $5 billion test test..}
  2.  
  3. # I need some fix in this code below to escape the error..
  4. set dirty [subst [regsub -- {^([A-ZÅÄÖ]{3,12})\s([A-ZÅÄÖ]{3,15}):\s} $dirty {[string totitle \1] [string totitle \2]: }]]
  5.  
  6.  
  7.  
  8.  
  9. #ERROR
  10. #can't read "5": no such variable
  11. # while executing
  12. # "subst [regsub -- {^([A-ZÅÄÖ]{3,12})\s([A-ZÅÄÖ]{3,15}):\s}