'Where can I get a c# class extensions that match the javascript string methods?

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


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source