RnD - 1 year ago 68

Java Question

I would like to get the whole row as my output. For example when i type kp1

I want the whole row CVBN.... returned.

`begin abc`

CVBN(r,t,t) + PPP(l,r) <-> ZEK(r!1).R(l!1,r) kp1,km1

TNBC(l,r) + SSR(r,t,t) <-> KPT(l,r!1).XXXX(l,r!1) kp2,km2

TLCX(l!+,(r,t,t)) + VV(l!+,r) <-> BB(l!+,r!1).R(l!+,r!1) kp3,km3

end abc

I tried the following:

`Pattern pattern = Pattern.compile("kp1");`

Matcher matcher = pattern.matcher(mytextFromAbove);

// Find all matches

while (matcher.find())

{

// Get the matching string

match = matcher.group();

}

This only returns the substring

Any help is really appreciated.

Thanks.