I tried the following regex:
sentences = sb.toString().split("(?<=[a-z])*\\.\\s*");
I am using a stringBuilder sb and converting it to string and then using a split function
The regex checks for 0 or more characters before '.' and 0 or more spaces after the '.'
However, it doesn't work for the following input
Hello World. Shipped to U.S on Friday.We are here .Good input
But I need to keep the space before We are here
Req Output
Hello World
Shipped to U.S on Friday
We are here
Good input
.
\\s*
part then?