mate-desktop / pluma

A powerful text editor for MATE
http://www.mate-desktop.org
GNU General Public License v2.0
158 stars 66 forks source link

Regex library not used in multiline mode #541

Closed superian closed 4 years ago

superian commented 4 years ago

It is possible that this is deliberate, but as a user of text editors and utilities like grep, I would say that..

Expected behaviour

^ should match the start of any line, not just the first. $ should match the end of any line, not just the last.

If I really want the very start of a file, I can use \A for example.

Actual behaviour

^ only matches the start of the first line. $ only matches the end of the last line.

From the documentation, which I now know is at https://developer.gnome.org/glib/stable/glib-regex-syntax.html, this suggests the library is not used in multiline mode, i.e. the G_REGEX_MULTILINE option is unset.

Steps to reproduce the behaviour

test.txt

11.aaa 222
11 aa 222
 11 aaa 222
11

^\d{2}\.\w{3}+.*

regex: ^\d{2}\.\w{3}+.*

Captura de Pantalla 2020-04-16 a les 18 51 19

Originally posted by @rbuj in https://github.com/mate-desktop/pluma/issues/538#issuecomment-614772038

Works! The line is found. But if you move the first line to anywhere else in the file, or insert a different first line before the current one, it doesn't.

MATE general version

1.24

Package version

1.24

Linux Distribution

Ubuntu MATE 20.04 LTS