I have a text file, and I need to divide it into blocks using regex in java.
Each block starts with a number at the start of the line and the rest is indented by tabs.
for example:
1. Here the block starts, and I need to capture
all the text until the next block starts.
2. The Second block.
3. Another block.
Some indented text.
4. New block.
More text.
Still the 4th block.
The end of the 4th block.
I tried few patterns, but I can't figure out how to do it.
I was thinking about:
a number at the start of a line
some text
a number at the start of a line
But this way the number at (3) will not be included at the next match, and the pattern will not catch the next block.