Closed superian closed 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..
^ 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.
^ 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.
test.txt
11.aaa 222 11 aa 222 11 aaa 222 11 ^\d{2}\.\w{3}+.*
regex: ^\d{2}\.\w{3}+.*
^\d{2}\.\w{3}+.*
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.
1.24
Ubuntu MATE 20.04 LTS
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
regex:
^\d{2}\.\w{3}+.*
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