什么是ereg()等价物

时间:2013-12-01 00:17:29

标签: regex equivalent ereg

Visual Basic .NET中的PHP ereg()等效是什么?

我正在尝试将这个tripcode编码器从PHP翻译成VB.NET

function tripcode($name)
{
    if(ereg("(#|!)(.*)", $name, $matches))
    {
        $cap  = $matches[2];
        $cap  = strtr($cap,"&", "&");
        $cap  = strtr($cap,",", ",");
        $salt = substr($cap."H.",1,2);
        $salt = ereg_replace("[^\.-z]",".",$salt);
        $salt = strtr($salt,":;<=>?@[\\]^_`","ABCDEFGabcdef"); 
        return "!".substr(crypt($cap,$salt),-10)."";
    }
}

1 个答案:

答案 0 :(得分:0)

        $Str = "#your_tripcode_password"
        Dim Reg As New Regex("(#|!)(.*)")
        If Reg.IsMatch(Str) Then
            Dim Cap$ = Reg.Matches(Str)(0).Groups(2).Value

        End If