Removing link..

General discussions about Advanced Find and Replace
Post Reply
norfeem
Posts: 1
Joined: Thu Feb 15, 2018 4:54 pm

Removing link..

Post by norfeem »

I currently have a Simple Find reg expr that is working perfectly
<a href="https://www.yyyy.com.*>?</a>
I want to replace above leaving only the ? values example when I search
My Results are

<a href="https://www.yyyy.com">123</a>
<a href="https://www.yyyy.com" target="_blank">789</a>
<a href="https://www.yyyy.com">456</a>

I want to replacement to be

<p>123</p>
<p>789</p>
<p>456</p>

Is the replacement as simple as
<p>?</p>

Abacre
Site Admin
Posts: 1223
Joined: Mon Jan 31, 2005 5:32 pm

Re: Removing link..

Post by Abacre »

Hello,
You should use regular expressions here.
Go to Batch Replace tab.
Check Use Regular expressions.
You should use:
Search for:
<a href="https://www\.yyyy\.com".*>(\d+)</a>

Replace with:
<p>$1</p>

Thus:
\d - any digit
\d+ - one or more digits
.* - any text (even empty).
() is used to capture the number.
$1 in replace part is used to put the captured number.

\. is used to escape . because dot is reserved char.
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

Post Reply