Regex - fiename as parameter in search replace
-
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 -
@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.
-
@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
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