macro search between <section>fixed & changing characters</section>
-
How can I search for a string that is changing in certain area’s and is different for different pages.
You see two strings below that changes when I publish my site through the software builder.
This string contains the domain name of the builder and although I understand why they do it, for SEO it is just very bad practice.
Currently, I have created a macro that adds “rel = nofollow” between <a & href="https://domain.name>However, I rather get rid of this link at all therefore I am looking to build a macro that
a) search on the part that never change which is "<section class=“engine”><a href=“https://domain.name”
b) remove everything between <section class=“engine”> and the closing </section>When I publish 5 pages then each page has a different line where the character behind the domain name is changing (or no character at all) and the anchor text is changing.
<section class=“engine”><a href=“https://domain.name/n”>simple site templates</a></section>
<section class=“engine”><a href=“https://domain.name/g”>build a site</a></section>If not possible with Notepadd++ maybe there is an editor that can do it.
-
I assume you can build a regex which would look like that
find with:(?s)(<section class="engine">)<a href="https\:\/\/domain\.name.*?(</section>)
replace with:\1\2Is this doing what you want to achieve?
-
@Ekopalypse many thanks, that indeed works and it basically removes it. saves a lot of time
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