Struggling with creating a regular expression to determine if a string is part of a numbered list like those in word processors.
Need it to return true only if the string starts with a number, followed by a full stop and a space.
Easy for single or double-digit numbers, but need regex for any size.
Example 1
"1. This is a string"
Should return true as it starts with "1. "
Example 2
"3245. This is another string"
Should also return true starting with "3245. "
Example 3
"This is a 24. string"
Should return false as there's no match at the beginning.
Example 4
"3. This is 24. string"
Still should return true.
Clear? Thanks for your help!