0

Hi I'm using this code:

Dim expr As String = "\<(.|\n)+?\>"

and was trying to remove the hyperlink below:

<a href="https://support.sample.com/applications/ManagemyEngagements/Documents/SolutionContingency.html" target="_blank">demo </a>

My target is to return the hyperlink description "demo" but when trying to replace the matched items with an empty string all are being replaced.

Desired result:

demo

Please help

Thanks!

4

1 に答える 1

1

文字列には 3 つの部分があります:
A: <a ...>
B: デモ
C:</a>

あなたが使用できるthous 3部分を一致させるために: /<a [^>]+>(.*?)<\/a>/

<a [^>]+>マッチ A、"" で始まる文字列
(.*?)マッチ B、貪欲ではない任意のデータ
<\/a>マッチ C、文字列 ""

于 2013-08-13T09:50:05.357 に答える