regular expression, on how to match cross lines
Submitted by Sunday, 31 January, 2010 - 10:56
on
Hello.
By default single dot "." in jEdit do not match line break. In effect it is pretty much the same as [^\n].
When I want to match across multiple lines, I often use [^韡], which matches \n just fine. e.g. the following matches everything between Section and EndSection, it can match a few hundreds lines just fine:
Section[^韡]*EndSection
This method is "invented" by me, because my name 韡 is a really rare character that hardly used anywere, and I just need an impossible character in [^] so that I can match across lines.
I write this post to ask what is the standard way to do so, than my home-brew method.
By default single dot "." in jEdit do not match line break. In effect it is pretty much the same as [^\n].
When I want to match across multiple lines, I often use [^韡], which matches \n just fine. e.g. the following matches everything between Section and EndSection, it can match a few hundreds lines just fine:
Section[^韡]*EndSection
This method is "invented" by me, because my name 韡 is a really rare character that hardly used anywere, and I just need an impossible character in [^] so that I can match across lines.
I write this post to ask what is the standard way to do so, than my home-brew method.