62,269
社区成员
发帖
与我相关
我的任务
分享string value = "aaa[img]这是才[img]11[/img]是值[/img]好了,结束了";
string regex = @"(?<=(\[img\]))(?<value>([^\[img\]]|[^\[/img\]]*))(?=(\[/img\]))";
System.Text.RegularExpressions.Regex reg = new System.Text.RegularExpressions.Regex(regex,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
System.Text.RegularExpressions.Match match = reg.Match(value);
if (match.Success)
{
string get = match.Groups["value"].Value;string value = "aaa[img]这是才是值[/img]好了,结束了";
string regex = @"(?<=(\[img\]))(?<value>(.*))(?=(\[/img\]))";
System.Text.RegularExpressions.Regex reg = new System.Text.RegularExpressions.Regex(regex,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
System.Text.RegularExpressions.Match match = reg.Match(value);
if (match.Success)
{
string get = match.Groups["value"].Value;
}