Community
    • Login

    I would like a plugin that lets you write code in JS to Find in File

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    4 Posts 3 Posters 420 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.
    • Eyal282E
      Eyal282
      last edited by

      After concluding Regex is not real, I would like to have a plugin that asks me to write a code that looks like this:

      function _find_in_file(textArray, resultsArray)
      {
      for(let i=0;i < textArray.length;i++)
      {
      let originalText = textArray[i];
      let alteredText = textArray[i];
      
      removeIdentation(alteredText );
      
      if(alteredText.startsWith("PrintToChat(")
      {
      
      // The array is the text that will be matched, obviously it will require also pushing the file the text is in, and the position it's in.
      resultsArray.push(originalText);
      }
      continue;
      }
      }
      
      1 Reply Last reply Reply Quote 0
      • Eyal282E
        Eyal282
        last edited by Eyal282

        I searched for 10 whole minutes, and wrote the code in 2 minutes.

        The objective is after removing any indents or \n \t \0 \x
        is to match for PrintToChat(…
        and to not match for PrintToChatAll(…
        and to not match for RP_PrintToChat

        Basically anti wildcard on *PrintToChat(

        Unfortunately could not find “anti wild card”

        Lycan ThropeL PeterJonesP 2 Replies Last reply Reply Quote 0
        • Lycan ThropeL
          Lycan Thrope @Eyal282
          last edited by Lycan Thrope

          @Eyal282 said in I would like a plugin that lets you write code in JS to Find in File:

          The objective is after removing any indents or \n \t \0 \x

          So, to encapsulate, you’re trying to remove \n (newline), \t (tab), I get these, but \0 or \x I don’t understand, unless you’re trying to remove a hex number \0xa0 and/or \0x0d type of thing. For those that might be able to help, you really should elaborate EXACTLY in the style of this forum available in the FAQ’s section here for how to format and phrase, the text or symbols you want removed.

          Good luck.

          1 Reply Last reply Reply Quote 0
          • PeterJonesP
            PeterJones @Eyal282
            last edited by

            @Eyal282 said in I would like a plugin that lets you write code in JS to Find in File:

            Basically anti wildcard on *PrintToChat(

            You don’t need “anti-wildcard”. You need “boundary” from the zero-width assertions. \bPrintToChat\b will search for that text, requiring either start-of-line or spaces/tabs or punctuation before, and end-of-line or spaces/tabs or punctuation after

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