Hello!
If I understand well, the problem is that
^ and
$ mean "start of the input text" and "end of the input text" (and not start and end of the
line).
Another problem is that
.* is too wide.
So one possibility would be to remove
^, to replace
$ with
\n, and to use
.*? instead of
.*.
'([0-9]+\..*?\n)|([a-z]\.+.*?\n)'
Or better (IMHO), we could use, instead of
., a more restrictive class, for example
[^\n].
'([0-9]+\.[^\n]*)|([a-z]\.+[^\n]*)'
Hope this helps.