Community
    • Login

    Regex - fiename as parameter in search replace

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 3 Posters 419 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.
    • R Offline
      RaniRani
      last edited by

      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

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA Offline
        Alan Kilborn @RaniRani
        last edited by

        @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
        • Terry RT Offline
          Terry R
          last edited by

          @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

          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