Community
    • Login

    Bug: Regular Expressions [^\v]* not working as expected

    Scheduled Pinned Locked Moved General Discussion
    3 Posts 3 Posters 2.9k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Sebastian ProskeS Offline
      Sebastian Proske
      last edited by

      When I use search with regular expressions, I would expect [^\v]* to match a whole line until the linebreak - but it matches the whole document. However \v works fine, as does \V - am I expecting wrong or is this a bug?

      Claudia FrankC 1 Reply Last reply Reply Quote 0
      • Claudia FrankC Offline
        Claudia Frank @Sebastian Proske
        last edited by

        Hello @Sebastian-Proske,

        seems that \v is used for vertivcal tab.

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 0
        • guy038G Online
          guy038
          last edited by guy038

          Hello Sebastian,

          First of all, sorry for my late reply :-(

          There a particularity of the BOOST Regex ligrary, about the regex syntax \v :

          • The regex \v represents any vertical blank character, that is to say one character which belongs to the range [\n\x0B\f\r]

          • The regex [\v] represents, ONLY, the vertical tabulation character, of Unicode code \x0B

          So, when you write [^\v], it matches any single character, which is different from the \x0b ( VT character )

          Thus, your regex [^\v]* represents any set, even empty, of characters, different from the Vertical Tabulation character, included any End Of Line character ( \r, \n or \r\n)

          In other words, if your current file does NOT contain any \x0b character, your regex [^\v]* matches, absolutely, all the characters of the file. Quite logical !

          Best Regards,

          guy038

          P.S. :

          The regex \V ( Uppercase v ) is equivalent to the range [^\n\x0B\f\r], that is to say any single character, different from a Vertical Tabulation, from a Form Feed character and from an EOL character.

          Again, if your file does NOT contain any \x0b and/or \x0c character(s), the regex \V+ matches successively, each whole line, without its line break !

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors