Sublime Text regex not detecting multiline tags

前端 未结 2 1001
夕颜
夕颜 2020-12-07 09:32

I have this regex here;

\\[sometag\\](.*)\\[/sometag\\]

Which is supposed to catch text surrounded by the [sometag] tag. It wo

2条回答
  •  有刺的猬
    2020-12-07 09:57

    At the start, use a dotall modifier (?s) to make dot to match also newline characters.

    (?s)\[sometag\](.*?)\[\/sometag\]
    

    DEMO

提交回复
热议问题