Re: [Vala] regex to get some multiline text
- From: Shawn Ferris <shawn ferris gmail com>
- To: Vala-list <Vala-list gnome org>
- Subject: Re: [Vala] regex to get some multiline text
- Date: Fri, 11 May 2012 17:33:19 -0600
On Wed, May 9, 2012 at 5:17 PM, Shawn Ferris <shawn ferris gmail com> wrote:
I'm not 100% sure on your use case, I didn't read it thoroughly, but I
believe you need to add a loop:
Oops.. I may have misunderstood your question.. I think you need to enable
multiline, which I believe is:
Regex r = /\s*(?P<start>.*)\s*%tag:(?P<**k
ey>.*)%\s*(?P<content>.*)\s*%**endtag%\s*(?P<end>.*)/m;
Note the m (multiline compiler flag) following the regexp. I'm not 100%
sure on that syntax as I'm used to:
Regex r = new Regex(""" \s*(?P<start>.*)\s*%tag:(?P<**
key>.*)%\s*(?P<content>.*)\s*%**endtag%\s*(?P<end>.*) """,
RegexCompileFlags.MULTILINE);
I inadvertently left the list off this reply.. However, MULTILINE was still
not enough.. '.' (dot) still wont match newlines w/o also
setting RegexCompileFlags.DOTALL.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]