- February 14, 2007 at 9:26 am #4175
I have the option Regular Expressions Can Match New Line Characters turned off. When I use the dot character, all works fine. But something like e.g. [^abc] matches newline characters. Is it intentional or not? I think, that’s quite inconvenient.April 5, 2007 at 2:59 am #4280ansmithMember
This causes a period (.) to match all characters including newlines (normally, it does not match newlines). However, when the newline character is at its default of CRLF (`r`n), two dots are required to match it (not one). Regardless of this option, a negative class such as [^xyz] always matches newlines.April 5, 2007 at 6:40 am #4281
If this is intentional, then the option have to be renamed from “Regular Expressions Can Match New Line Characters” to e.g. “Period Can Match New Line Characters”April 6, 2007 at 4:07 pm #4285Yutaka EmuraKeymaster
Actually, it used to be Period in some previous versions. Then I renamed to “Regular Expressions” because Regular Expresions include Period. Someone reported this preference because it is not only Period that can match new lines.April 6, 2007 at 4:22 pm #4287
So, is this intentional that [^xyz] matches newlines? Could it be made e.g. optional, that is – if I select that the regexps work in one single line only, they really worked in one single line only? What’s the usefulness of the option that sometimes works, sometimes not?April 7, 2007 at 3:11 am #4289VladMember
It’s all my fault! It was me who requested change from something like “dot matches newline” to “regexps match newline” because I got confused several time using regexps like [^a-z]. And it was different depending on whether I searched in single or multiple files.
Now [^a-z] and s match newlines if “regexps match newline” is off, but only if “additional lines to search …” is not 0. If you set “additional lines to search …” to 0 you should get single line searches. I am not sure though, this is confusing.
Perhaps this is a bug and “additional lines to search …” should be disabled when “regexps match newline” is disabled?
- You must be logged in to reply to this topic.