16,554
社区成员
发帖
与我相关
我的任务
分享
string s = "www.myurl.com/abcd.html";
s = Regex.Replace(s, @"(http://)?www.myurl.com/([\w]*)\.html", "http://www.myurl.com/sss.aspx?id=$2");
Imports System.Text.RegularExpressions
Module Module1
Sub Main()
Dim str = "www.myurl.com/abcd.html"
Console.WriteLine(GetHtml(str))
End Sub
Function GetHtml(ByVal input As String) As String
Return Regex.Replace(input, "(.+)/([^.]+)\.(html)", "$1/" & "SSS" & ".aspx?id=" & "$2")
End Function
End Module