Html Powershell正则表达式要匹配除第一个之外的字符串

Html Powershell正则表达式要匹配除第一个之外的字符串,html,regex,powershell,match,Html,Regex,Powershell,Match,我有以下html模式 href="{{url}}" class="item-name prdctNm">{{name}}</a><div> href="/drugs/sporanox-100-mg-33294" class="item-name prdctNm">Sporanox (100 Mg)</a> href="/drugs/sporan-200-mg-34240" class="item-name prdctNm">Sporan (2

我有以下html模式

href="{{url}}" class="item-name prdctNm">{{name}}</a><div>
href="/drugs/sporanox-100-mg-33294" class="item-name prdctNm">Sporanox (100 Mg)</a>
href="/drugs/sporan-200-mg-34240" class="item-name prdctNm">Sporan (200 Mg)</a>
href="/drugs/spornid-500-mg-25051" class="item-name prdctNm">Spornid (500 Mg)</a>

使用下面的正则表达式,然后在最后打印组索引1,其中
Groups[0]
包含整个匹配项,
Groups[1]
包含第一个组捕获的字符

$regex = [RegEx]'"item-name prdctNm">([^}{<>]*)</a>'
$url = ‘https://www.xxx.com/search/all?name=sporanox’
$wc = New-Object System.Net.WebClient
$content = $wc.DownloadString($url)
$regex.Matches($content) | ForEach-Object { $_.Groups[1].Value }
$regex=[regex]'“项目名称prdctNm”>([^}{]*)”
$url='1https://www.xxx.com/search/all?name=sporanox’
$wc=新对象System.Net.WebClient
$content=$wc.DownloadString($url)
$regex.Matches($content)| ForEach对象{$\.Groups[1].Value}

谢谢,如果我在正则表达式中包含“”,这会起作用。有没有办法-我可以指示我的正则表达式首先匹配到。希望你理解我的问题。简单,在
*
旁边使用非贪婪或不情愿的量词
[RegEX]“
@Yogesh把它作为一个单独的问题来问。我对powershell了解不多。
$regex = [RegEx]'"item-name prdctNm">([^}{<>]*)</a>'
$url = ‘https://www.xxx.com/search/all?name=sporanox’
$wc = New-Object System.Net.WebClient
$content = $wc.DownloadString($url)
$regex.Matches($content) | ForEach-Object { $_.Groups[1].Value }