Regular Expression to find string in Expect buffer

前端 未结 2 2018
情歌与酒
情歌与酒 2021-01-25 06:19

I\'m trying to find a regex that works to match a string of escape characters (an Expect response, see this question) and a six digit number (with alpha-numeric first character)

2条回答
  •  粉色の甜心
    2021-01-25 06:53

    If you just want the number at the end, then this should be enough...

    [0-9]{6}
    

    Update with new information

    Assuming \n is a newline character, rather than a literal \ followed by a literal n, you can do this...

    \r\n\u001B\[1;14H(X[0-9]{5})
    

提交回复
热议问题