Community
    • Login

    Replace Help

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 1.4k Views 1 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.
    • BortfiveB Offline
      Bortfive
      last edited by

      Hi guys,

      I am trying to replace

      That
      Hint “Any Text Here”
      With
      [“Any text Here”] spawn life_fnc_hint

      The Any text here, is not the text that i want, Its like that

      https://i.imgur.com/ZGJf93q.png

      I have a lot of work to do if anyone found the way to do it :)

      https://i.imgur.com/WOlws9w.png

      Can anybody try to help me?

      Thank you in advance.

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

        Hello, @bortfive,

        • First, I strongly advice you to backup your 271 files !

        • Then, test my regex search/replacement, below, on one file, only !


        • Copy **one of your files in a new tab ( Ctrl + N )

        • Open the Replace dialog ( Ctrl + H )

        • Type in the regex (?-is)^hint (".+?"); , in the Find what: zone

        • Type in the regex [\1] spawn life_fnc_hint , in the Replace with: zone

        • Tick the Wrap around option

        • Click on the Replace All button

        Et voilà !

        Note that, only, all ranges hint ".......";, beginning the lines, are matched !

        So, given the initial text, below :

        hint "Ahora ves los nombres de los jugadores";   hint "This is a test !";
        
        hint "  Has dejado de ver los nombres de los jugadores   ";
        

        You should obtain :

        ["Ahora ves los nombres de los jugadores"] spawn life_fnc_hint   hint "This is a test !";
        
        ["  Has dejado de ver los nombres de los jugadores   "] spawn life_fnc_hint
        

        Now, if you may have several zones hint ".......";, in a same line, change the search regex to :

        (?-is)hint (".+?");

        And, you’ll get the following text :

        ["Ahora ves los nombres de los jugadores"] spawn life_fnc_hint   ["This is a test !"] spawn life_fnc_hint
        
        ["  Has dejado de ver los nombres de los jugadores   "] spawn life_fnc_hint
        

        Notes :

        • First, the (?-is) modifiers :

          • Force the regex engine to consider any dot as matching one single standard character ( and not the EOL ones )

          • Force the search to be sensitive to case ( => So, a line HINT "...."; or Hint "...."; is not matched ! )

        • The part .+? represents the shorter range of characters between the two boundaries "

        • As this range "....." is surrounded by parentheses, it is stored as group 1

        • In replacement, the \1 syntax stands for the group 1 contents

        Best Regards,

        guy038

        BortfiveB 1 Reply Last reply Reply Quote 0
        • BortfiveB Offline
          Bortfive @guy038
          last edited by

          @guy038 i will try it, u are the best bro <3

          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