mdzzbu

 

截取"方向正确"

string str="不管前方的路有多苦,只要走的方向正确,不管多么崎岖不平,都比站在原地更接近幸福 "

s="走的";

e=" ,不管"

 

public static string Extract(string str, string s, string e)
{
Regex rg = new Regex("(?<=(" + s + "))[.\\s\\S]*?(?=(" + e + "))", RegexOptions.Multiline | RegexOptions.Singleline);
return rg.Match(str).Value;
}

注意:特殊字符,大小写 中英文对应

分类:

技术点:

相关文章:

  • 2021-10-09
  • 2021-12-01
  • 2021-10-09
  • 2021-10-09
  • 2021-11-27
  • 2022-02-09
  • 2021-10-09
  • 2021-10-09
猜你喜欢
  • 2021-10-09
  • 2021-10-09
  • 2021-10-09
  • 2021-11-17
  • 2021-10-09
相关资源
相似解决方案