Posted to tcl by mjanssen at Fri Feb 26 18:21:29 GMT 2021view raw
- set s1 "13211321322113311213212312311211131122211213211331121321123123211231131122211211131221131112311332211213211321223112111311222112132113213221123123211231132132211231131122211311123113322112111312211312111322111213122112311311123112112322211213211321322113311213212312311211131211131221223113112221131112311332211211131221131211132211121312211231131112311211232221121113122113121113222123211211131211121311121321123113213221121113122123211211131221222112112322211213211321322113311213212312311211131122211213211321322113221321132132211231131122211331121321232221121113122113121122132112311321322112111312211312113221133211322112211213322112"
- set rep [string length $s1]
- set s2 [string repeat x $rep]
- puts [time {regexp -all -inline {(.)\1*} $s2}]
- puts [time {regexp -all -inline {(.)\1*} $s1}]