Match Sequence using RegEx After a Specified Character

前端 未结 3 911
温柔的废话
温柔的废话 2020-12-05 13:46

The initial string is [image:salmon-v5-09-14-2011.jpg]

I would like to capture the text \"salmon-v5-09-14-2011.jpg\" and used GSkinner\'s RegEx Tool

3条回答
  •  情深已故
    2020-12-05 14:14

    Use a look-behind:

    (?<=:)[\w+.-]+
    

    A look-behind (coded as (?<=someregex)) is a zero-width match, so it asserts, but does not capture, the match.

    Also, your regex may be able to be simplified to this:

    (?<=:)[^\]]+
    

    which simply grabs anything between (but not including) a : and a ]

提交回复
热议问题