Browse Source

Get-NameRegex: exist key tag in regex string , merge into one.

temp1
pcnick 3 years ago
parent
commit
094e1aeca7
  1. 7
      NameRegex.ps1

7
NameRegex.ps1

@ -6,8 +6,11 @@
# Regex 可輸入複數個
Write-Host $Str
$Regex | % {
$key = if ($_ -match "\(\?\<(.*?)\>") { $Matches[1] }
if (-not($key)) { Write-Error "$_ 沒有定義(?<TAG>)" }
$key = if ($_ -match "\(\?\<(.*?)\>") {
$Matches[1]
} else {
Write-Error "$_ 沒有定義(?<TAG>)"
}
if ($Str -match $_ -and($key)) {
$Result = @{
$key = $Matches[$key]

Loading…
Cancel
Save