• Login
Community
  • Login

Which searchFlag will help me?

Scheduled Pinned Locked Moved Notepad++ & Plugin Development
5 Posts 3 Posters 353 Views
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.
  • P
    Peter Goddard
    last edited by May 29, 2020, 6:21 PM

    Hi,

    I am making a plugin that tries to search for every “<” in a text file and place a new line before it. The problem is that the “<” may be inside of a word or between 2 words. Which searchFlag will help me to specify that I want to do this to all “<”? Here’s an example of what I am working with.help5.JPG

    Thanks

    E 1 Reply Last reply May 30, 2020, 12:04 PM Reply Quote 0
    • E
      Ekopalypse @Peter Goddard
      last edited by May 30, 2020, 12:04 PM

      @Peter-Goddard

      the searchFlags tell scintilla only how your search_string needs to be interpreted but don’t, magically, find the positions.
      I find the description quite understandable where is your problem here?

      P 1 Reply Last reply Jun 1, 2020, 1:18 PM Reply Quote 0
      • P
        Peter Goddard @Ekopalypse
        last edited by Jun 1, 2020, 1:18 PM

        @Ekopalypse I just want to make sure I get the right one

        E 1 Reply Last reply Jun 1, 2020, 3:16 PM Reply Quote 0
        • E
          Ekopalypse @Peter Goddard
          last edited by Jun 1, 2020, 3:16 PM

          @Peter-Goddard

          Again, there is no wrong or right without knowing what you are trying to achieve and how.
          I know you want to find every occurrence of something, but how do you code it? I mean, if you want to use a regular expression, then you have to use SCFIND_REGEXP, but if you want to search only literally, then you should consider SCFIND_NONE …
          Hard to tell which one is the right one.

          1 Reply Last reply Reply Quote 1
          • R
            rinku singh
            last edited by Jun 1, 2020, 3:43 PM

            find < and replace it with \r\n< by regex

            1 Reply Last reply Reply Quote 0
            2 out of 5
            • First post
              2/5
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors