The raw data is:
auser1 home1b auser2 home2b auser3 home3b
I want to match a line, but it doesn\'t work using ^(.*?)$
^(.*?)$
we can also use the flag MULTILINE,
MULTILINE
Matcher m = Pattern.compile("^.*$",Pattern.MULTILINE).matcher(text);
This will enable the multiline mode which will gave you the expected result.