Sublime Text regex not detecting multiline tags

前端 未结 2 1002
夕颜
夕颜 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

    0 讨论(0)
  • 2020-12-07 09:59

    If modifying of dot's mode is inadmissible for some reasons, you may take that:

    [sometag](.|\n)+?[/sometag]
    
    0 讨论(0)
提交回复
热议问题