Regex not stopping at first space

后端 未结 5 1766
说谎
说谎 2021-01-05 03:20

Trying to create a pattern that matches an opening bracket and gets everything between it and the next space it encounters. I thought \\[.*\\s would achieve th

5条回答
  •  清歌不尽
    2021-01-05 03:38

    Use this:

    \[[^ ]*
    

    This matches the opening bracket (\[) and then everything except space ([^ ]) zero or more times (*).

提交回复
热议问题