I noticed that dotnet is missing a lot of the javascript methods related to regular expression with the string class, for instince string.match().
Is there a class extension for c#/powershell that implements these missing method of the string class so that it more closely matches javascript?
For example in powershell I can add the method RegexCount() to the dotnet string class as follows:
$proto_RegexCount = @{
Force = $true
TypeName = "System.String"
MemberName = "RegexCount"
MemberType = [System.Management.Automation.PSMemberTypes]::ScriptMethod
Value = {
param([regex]$Regex)
$Regex.Matches($this).Count
}
}
Update-TypeData @proto_RegexCount