in Java I want to remove some text from the following String via Regexp:
someText
begin
.someMethod()
.doSomething(TOKEN_123)
.someMethod()
end
begin
.someMethod()
.doSomething(TOKEN_456)
.someMethod()
end
begin
.someMethod()
.doSomething(TOKEN_789)
.someMethod()
end
more Text
I want to remove the 2nd begin/end-Block which includes the String TOKEN_456.
Currently my regexp looks like the following
begin.*TOKEN_456(.*?)end
but this one removes the first AND second block.
Can anyone help please?
Greetz