I am really trying to find a regex that will reliably check if a string is part of a numbered list (for example, those you find in a common word processor).
So I would like it to return true if the beginning of the line is a number followed by fullstop and a space .
For single or even double-digit numbers, I can of course do this easily without the need for regular expressions, but since the number can be of any size, it will not work.
Example 1
"1. This is a string"
Should return true , because the line starts with: "1."
Example 2
"3245. This is another string"
Should return true , because the line starts with: "3245."
Example 3
"This is a 24. string"
Must return false
Since there is no pattern matching at the beginning of the line ... however ...
Example 4
"3. This is 24. string"
Should still return true
Hope this is clear enough.
Thanks in advance for your help.
Gordo source share