• Login
Community
  • Login

Copy the text behind the parentheses and paste it into the double quotes

Scheduled Pinned Locked Moved General Discussion
3 Posts 2 Posters 246 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.
  • D
    David Costache
    last edited by Apr 22, 2020, 8:33 PM

    I would like to know the expression to perform this action for a 900+ lines.

    Before:

    ACACIA_BOAT(""); 
    ACACIA_BUTTON("");  
    ACACIA_DOOR("");
    

    After:

    ACACIA_BOAT("ACACIA_BOAT"); 
    ACACIA_BUTTON("ACACIA_BUTTON"); 
    ACACIA_DOOR("ACACIA_DOOR");
    

    Basically, what I want to achieve is to have the text before the parentheses copied and placed where the quotes are. As the example above.

    E 1 Reply Last reply Apr 22, 2020, 8:44 PM Reply Quote 0
    • E
      Ekopalypse @David Costache
      last edited by Apr 22, 2020, 8:44 PM

      @David-Alexandru said in Copy the text behind the parentheses and paste it into the double quotes:

      Something like this would do it if your real data is like you posted.
      find what: (\w+)\(""\);
      replace with: \1\("\1"\);
      check regular expression in search mode

      D 1 Reply Last reply Apr 22, 2020, 8:48 PM Reply Quote 2
      • D
        David Costache @Ekopalypse
        last edited by Apr 22, 2020, 8:48 PM

        @Ekopalypse It worked! Thank you a lot!

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