Regular expressions in expect

后端 未结 2 901
再見小時候
再見小時候 2021-01-19 04:26

I just started learning expect scripting.I have been trying to extract the following from my output:

core.4046140998.01.10.133211

with an e

2条回答
  •  囚心锁ツ
    2021-01-19 05:13

    You have missed a . after \.:

    ^(core)\..*(\*)$
    

    \. matches a literal . and . matches any single character.

    Or you can use the non-greedy version:

    ^(core)\.[^*]*(\*)$
    

提交回复
热议问题