Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #4175
    CaptainFlint
    Participant

    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.

    #4280
    ansmith
    Member

    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.

    #4281
    CaptainFlint
    Participant

    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”

    #4285
    Yutaka Emura
    Keymaster

    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.

    #4287
    CaptainFlint
    Participant

    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?

    #4289
    Vlad
    Member

    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?

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.