• Login
Community
  • Login

Regex - fiename as parameter in search replace

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
3 Posts 3 Posters 196 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.
  • R
    RaniRani
    last edited by Apr 25, 2021, 7:42 AM

    Hi
    I want to add a canonical meta tag to all site’s pages by adding:

    <link rel=“canonical” href=“http://www.website.com/ <filenmame>”>

    How do I do fetch the filename using regex across all site?
    (I know how to do it using the menu. I want to do it automatically).

    Thanks
    Rani

    A 1 Reply Last reply Apr 25, 2021, 11:15 AM Reply Quote 0
    • A
      Alan Kilborn @RaniRani
      last edited by Apr 25, 2021, 11:15 AM

      @RaniRani said in Regex - fiename as parameter in search replace:

      How do I do fetch the filename using regex

      Unfortunately that isn’t an operation that is supported by regex.

      1 Reply Last reply Reply Quote 0
      • T
        Terry R
        last edited by Apr 25, 2021, 11:41 AM

        @RaniRani said in Regex - fiename as parameter in search replace:

        How do I do fetch the filename using regex across all site?

        I’m not sure I fully understand what you want to do however I provided a solution in this post which dealt with getting the filename of each opened file in Notepad++, saving it within the file and closing the file.

        Then a regex was used to update each file by copying that filename to selected (actually all) lines within the file. As @Alan-Kilborn stated the filename isn’t available to regex as a variable you can call on, but my first step was just a macro recording the use of menu options which then allowed a regex to complete the process.

        So take a look and see if maybe it might help. Reply back to this post if you think this can help you and you need a bit of extra help.

        I’m not on a PC currently otherwise I might have provided some more details.

        Terry

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