Метод строки isidentifier() поможет узнать, подходит ли данная строка в качестве имени объекта.
Вполне может заменить самостоятельно придуманную регулярку.
>>> 'some_name'.isidentifier()
True
Обычное имя переменной
>>> '私は手紙です'.isidentifier()
True
Юникод в качестве имени тоже доступен
>>> '1_name'.isidentifier()
False
Имя не может начинаться с цифры
>>> '੬_name'.isidentifier()
False
Включая все цифры юникода
>>> 'some name'.isidentifier()
False
Пробелы недопустимы
#basic
Let's come forward with #JanBhagidari to clean our water bodies and raise awareness about the cleanliness of them🏖️🌊
Take the Puneet Sankalp Pledge to tackle the issue of plastic pollution for a better tomorrow!
Visit: https://pledge.mygov.in/puneet-sankalp/
Your opinion can help us build a #NewIndia of our dreams. Tell us your ideas for Union Budget 2023-24 and join the good governance of #JanBhagidari
Visit: https://www.mygov.in/group-issue/inviting-ideas-and-suggestions-union-budget-2023-2024/
#JanBhagidari के जरिए राष्ट्रीय पोषण मिशन अब एक #JanAndolan बन गया है। इससे महिलाओं, गर्भवती और दूध पिलाने वाली माताओं, बच्चों और किशोरों की पोषण स्थिति में तेजी से सुधार देश की भावी पीढ़ी को सुरक्षित कर रहा है। #PoshanAbhiyaan2023
https://youtu.be/FKkEDtQ15tc
Rashtriya Poshan Mission now becoming a #JanAndolan with the help of #JanBhagidari
It is improving the nutritional status of women, pregnant and lactating mothers, children and adolescents. The moment is securing the future generation of India.
#PoshanAbhiyaan2023
https://youtu.be/FKkEDtQ15tc