diff --git a/Public/New-HTMLText.ps1 b/Public/New-HTMLText.ps1 index 9be02e1b..615ae792 100644 --- a/Public/New-HTMLText.ps1 +++ b/Public/New-HTMLText.ps1 @@ -279,7 +279,8 @@ function New-HTMLText { if ($FindMe) { foreach ($find in $FindMe) { $LinkName = ([regex]::Match($Find.value, "[^\[]+(?=\])")).Value - $LinkURL = ([regex]::Match($Find.value, "(?<=\().+(?=\))")).Value + $res = [regex]::Matches($Find.value, "\(([^)]+)\)") + $LinkURL = $res.captures.groups[$res.captures.groups.count-1].Value $Link = New-HTMLAnchor -HrefLink $LinkURL -Text $LinkName $Text[$i] = $Text[$i].Replace($find.value, $Link) } @@ -333,4 +334,4 @@ function New-HTMLText { } Register-ArgumentCompleter -CommandName New-HTMLText -ParameterName Color -ScriptBlock $Script:ScriptBlockColors -Register-ArgumentCompleter -CommandName New-HTMLText -ParameterName BackgroundColor -ScriptBlock $Script:ScriptBlockColors \ No newline at end of file +Register-ArgumentCompleter -CommandName New-HTMLText -ParameterName BackgroundColor -ScriptBlock $Script:ScriptBlockColors