[Geany-Devel] Regex in 1.25 and 1.26
Mark Robinson
mark.robinson at xxxxx
Fri Jan 1 16:52:26 UTC 2016
Oh, I see now. Cool, the multi-line works just fine, thank you...M
-----Original Message-----
From: Devel [mailto:devel-bounces at lists.geany.org] On Behalf Of Colomban Wendling
Sent: 21 December 2015 19:45
To: Geany development list <devel at lists.geany.org>
Subject: Re: [Geany-Devel] Regex in 1.25 and 1.26
Le 21/12/2015 18:31, Mark Robinson a écrit :
> Hi Guys,
>
> Is the regular expression capability broken in 1.25 and 1.26
>
> In 1.24, if I pop up the Find dialogue on a simple text file, I can
> search for \n with reg. expressions ticked and I find the end of the
> line.
>
> If I do this in 1.25 or 1.26, it does not find the end of the line and
> claims it cannot find \n.
>
> I notice single line reg. exp. was added at 1.25.
Which is the reason of your problem :) Single-line regular expressions can't find the \n because it's not part of the line itself, and in a line-based regular expression the line end is $ (as it's the end of the input).
So yes, 1.25 changed behavior by implementing single-line regular expressions and making it the default (because I believed it was more commonly what people were after, esp. because there's a history of people confused by some multi-line results).
This doesn't mean you can't search for \n: you can either switch back to multi-line regular expressions (there's a checkbox just for that), or if you want to search for line ends (e.g. if line ends are not \n in your file(s)), use $ with single-line regexes.
Regards,
Colomban
_______________________________________________
Devel mailing list
Devel at lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/devel
More information about the Devel
mailing list