这是我的输入:
27:15 And Rebekah took goodly raiment of her eldest son Esau, which^p were with her in the house, and put them upon Jacob her younger son:^p 27:16 And she put the skins of the kids of the goats upon his hands,^p and upon the smooth of his neck: 27:17 And she gave the meat^p and the bread, which she had prepared, into the hand of her son Jacob.
这里^p是回车
它应该作为 27:15 contents
在一行中添加到数据库中,在另一行中作为 27:16 contents
...
使用我试过的正则表达式:
var m = Regex.Match(line, @"\n\d+:");
if (m.Success)
{
html = html.Replace(m.Value, "</p>\n<p>" + m.Value);
}
我的输出是这样的:
2
7:15 contents
我想存储 27:15 内容
..我试过了,但没有得到答案。
最佳答案
我建议你改变你的正则表达式
var m = Regex.Match(line, @"\d+:\d+")
它将在 27:15 返回给您
关于c# - 使用 C# 的正则表达式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15333327/