常用的循环

作者: 飞奔的大虎 | 来源:发表于2021-07-16 09:28 被阅读0次

    [1] 某一数组,逐个赋值

    foreach P [list {a1 a2 a3 a4} {b1 b2 b3 b4} {c1 c2 c3 c4}] {

                      set Rllx [lindex $P 0]

                      set Rlly [lindex $P 1]

                      set Rurx [lindex $P 2]

                      set Rury [lindex $P 3]

    }

    [2] regexp 作用:匹配正则表达式及字符串。

    set string "/fs/omp_hlb_16/shusenwang/lb_otn_otu_master_top/REV0201_0301_ 210907_0000-func_pnr1_flow_0907"

    set result [regexp {\/(REV[^\.]+)} $string match var1 var2]

    <@dahu>puts "$match"

    /REV0201_0301_ 210907_0000-func_pnr1_flow_0907

    <@dahu>puts "$var1"

    REV0201_0301_ 210907_0000-func_pnr1_flow_0907

    <@dahu>puts "$var2"

    啥都没有

    [3]

    相关文章

      网友评论

        本文标题:常用的循环

        本文链接:https://www.haomeiwen.com/subject/arrmpltx.html