转换函数代码如下:
public string RegexToCsharp(string pattern)
{
string[] elements = pattern.Split('/');
string[] elements2 = elements[0].Split('[');
string element = elements2[0];
string[] elements3 = element.Split('(');
string element2 = elements3[0];
string[] elements4 = element2.Split(')');
string element3 = elements4[0];
string[] elements5 = element3.Split(',');
string element4 = elements5[0];
string[] elements6 = element4.Split(' ');
string element5 = elements6[0];
string[] elements7 = element5.Split(' ');
string element6 = elements7[0];
string[] elements8 = element6.Split('/');
string element7 = elements8[0];
string[] elements9 = element7.Split('[');
string element8 = elements9[0];
string[] elements10 = element8.Split(' ');
string element9 = elements10[0];
string[] elements11 = element9.Split('(');
string element10 = elements11[0];
string[] elements12 = element10.Split(')');
string element11 = elements12[0];
string[] elements13 = element11.Split(',');
string element12 = elements13[0];
string[] elements14 = element12.Split(' ');
string element13 = elements14[0];
string[] elements15 = element13.Split(' ');
string element14 = elements15[0];
string[] elements16 = element14.Split('/');
string element15 = elements16[0];
string[] elements17 = element15.Split(' ');
string element16 = elements17[0];
string[] elements18 = element16.Split('[');
string element17 = elements18[0];
string[] elements19 = element17.Split(' ');
string element18 = elements19[0];
string[] elements20 = element18.Split(')');
string element19 = elements20[0];
string[] elements21 = element19.Split(',');
string element20 = elements21[0];
string[] elements22 = element20.Split(' ');
string element21 = elements22[0];
string[] elements23 = element21.Split(' ');
string element22 = elements23[0];
string[] elements24 = element22.Split('/');
string element23 = elements24[0];
string[] elements25 = element23.Split(' ');
string element24 = elements25[0];
string[] elements26 = element24.Split('[');
string element25 = elements26[0];
string[] elements27 = element25.Split(' ');
string element26 = elements27[0];
string[] elements28 = element26.Split(')');
string element27 = elements28[0];
string[] elements29 = element27.Split(',');
string element28 = elements29[0];
string[] elements30 = element28.Split(' ');
string element29 = elements30[0];
string[] elements31 = element29.Split(' ');
string element30 = elements31[0];
string[] elements32 = element30.Split('/');
string element31 = elements32[0];
string[] elements33 = element31.Split(' ');
string element32 = elements33[0];
string[] elements34 = element32.Split(' ');
string element33 = elements34[0];
string[] elements35 = element33.Split('[');
string element34 = elements35[0];
string[] elements36 = element34.Split(' ');
string element35 = elements36[0];
string[] elements37 = element35.Split(' ');
string element36 = elements37[0];
string[] elements38 = element36.Split(')');
string element37 = elements3
领取专属 10元无门槛券
手把手带您无忧上云