如何匹配以下行:
SomeText SomeText SomeText SomeText SomeText
SomeText SomeText SomeText SomeText SomeText SomeText SomeText SomeText SomeText SomeText.
SomeText SomeText SomeText SomeText SomeText SomeText SomeText SomeText SomeText SomeText.
SomeText SomeText :
SomeText SomeText SomeText SomeText SomeText SomeText (BlockID: 12345,TestCaseID: 12345, 1)
我想要的是之前的整个部分(BlockID:12345,TestCaseID:12345,1) 我想要的另一部分是BlockID的12345,另一个是TestCaseID
我已尝试以下标记所有行,但我不知道:
(?:[^\n]*(\n*))+.*
答案 0 :(得分:0)
直到BlockID的所有内容:
([\S\s]*)(?=\(BlockID)
来自BlockID的12345:
(?:BlockID: )([0-9]{5})
12345,1来自TestCaseID:
(?:TestCaseID: )([0-9]{5}, [0-9])
答案 1 :(得分:0)
根据您的实际输入类型,我可以推荐类似
的内容p1 = new Plyta(p1.ImtiIlgi(), p1.ImtiAuksti());
表示:
public Plyta(){}
标志的新行),int a = 1;
int b = 2;
Plyta p1;
p1 = new Plyta(a, b);
,(.+)\\(BlockID: (\\d+),TestCaseID: (\\d+), 1\\)
,DOTAL
。这是在工作中:
BlockID:
输出:
SomeText SomeText SomeText SomeText SomeText
SomeText SomeText SomeText SomeText SomeText SomeText SomeText SomeText SomeText SomeText。
SomeText SomeText SomeText SomeText SomeText SomeText SomeText SomeText SomeText SomeText。
SomeText SomeText:
SomeText SomeText SomeText SomeText SomeText SomeText
12345个
12345