check the code i posted above. It has 2 words, but if you print found, it shows only the second word. The length is 1.
So, it starts counting on 1, but for some reason, your regex is skipping the first word. If you have only one word in the paragraph variable, the result is null.
It is correct. Counting Cyrillic words. But it starts counting from 0 not from 1.
check the code i posted above. It has 2 words, but if you print found, it shows only the second word. The length is 1.
So, it starts counting on 1, but for some reason, your regex is skipping the first word. If you have only one word in the paragraph variable, the result is null.
You are checking if space exists before word. Since first word doesn't have space before it, it fails to count it.