@@ -275,7 +275,7 @@ while ($in_progress -gt 0) {
275275 $ver = $Version
276276
277277 if (! $ver ) {
278- if (! $regex -and $replace ) {
278+ if (! $regexp -and $replace ) {
279279 next " 'replace' requires 're' or 'regex'"
280280 continue
281281 }
@@ -300,7 +300,7 @@ while ($in_progress -gt 0) {
300300
301301 if ($jsonpath ) {
302302 # Return only a single value if regex is absent
303- $noregex = [String ]::IsNullOrEmpty($regex )
303+ $noregex = [String ]::IsNullOrEmpty($regexp )
304304 # If reverse is ON and regex is ON,
305305 # Then reverse would have no effect because regex handles reverse
306306 # on its own
@@ -348,19 +348,19 @@ while ($in_progress -gt 0) {
348348 }
349349
350350 if ($regexp ) {
351- $regex = New-Object System.Text.RegularExpressions.Regex($regexp )
351+ $re = New-Object System.Text.RegularExpressions.Regex($regexp )
352352 if ($reverse ) {
353- $match = $regex .Matches ($page ) | Select-Object - Last 1
353+ $match = $re .Matches ($page ) | Select-Object - Last 1
354354 } else {
355- $match = $regex .Matches ($page ) | Select-Object - First 1
355+ $match = $re .Matches ($page ) | Select-Object - First 1
356356 }
357357
358358 if ($match -and $match.Success ) {
359359 $matchesHashtable = @ {}
360- $regex .GetGroupNames () | ForEach-Object { $matchesHashtable.Add ($_ , $match.Groups [$_ ].Value) }
360+ $re .GetGroupNames () | ForEach-Object { $matchesHashtable.Add ($_ , $match.Groups [$_ ].Value) }
361361 $ver = $matchesHashtable [' 1' ]
362362 if ($replace ) {
363- $ver = $regex .Replace ($match.Value , $replace )
363+ $ver = $re .Replace ($match.Value , $replace )
364364 }
365365 if (! $ver ) {
366366 $ver = $matchesHashtable [' version' ]
0 commit comments