I use preg_match()
to parse a string, which can have several options:
1.Черный (black.png) 1.Черный (black.png) Черный (black.png) 1.Черный 1.Черный Черный
It is necessary that where the indicated value is returned: 1) a digit to the point (if there is a digit with a dot) 2) after a dot to the parenthesis (if there is or until the end of the line) 3) what is in the round brackets (if there is)
I managed to read variants without values in parentheses:
/(^\d+)?\.?\s+?(.*)/u
Please tell me the options or help advice.