string s = "<html>1234</html>"; Regex reg = new Regex(@".*\>(?<mm>.*)\<.*"); MessageBox.Show(reg.Match(s).Groups["mm"].Value);
(?<=\<html\>).*(?=\</html\>)正则
[code=C#](?is)(?<=<html>).*?(?=</html)[code]
诶其,如果简单的话就else
Regex r = new Regex(@"\d+",RegexOptions.Compiled); string str = r.Match(s).ToString(); MessageBox.Show(str);
只能针对<html>1234</html>";红色区域一定要数字,不能有//,/这些啊
you can write 3 functions, the first one get the right side of a seperator, the second one get the left side of a seperator, the third one get the one between two seperators using the functions above. all use substring.ps: why my google-pingyin is always broken??
string html = System.Text.RegularExpressions.Regex.Replace(s, "<[^>]+>", "");
MessageBox.Show(html);
string abc = "<html>1234</html>";
abc=abc.Substring(6,abc.IndexOf("</html>")-1);
Regex reg = new Regex(@".*\>(?<mm>.*)\<.*");
MessageBox.Show(reg.Match(s).Groups["mm"].Value);
(?<=\<html\>).*(?=\</html\>)正则
Regex r = new Regex(@"\d+",RegexOptions.Compiled);
string str = r.Match(s).ToString();
MessageBox.Show(str);
the second one get the left side of a seperator,
the third one get the one between two seperators using the functions above.
all use substring.ps: why my google-pingyin is always broken??