Метод строки isidentifier() поможет узнать, подходит ли данная строка в качестве имени объекта.
Вполне может заменить самостоятельно придуманную регулярку.
>>> 'some_name'.isidentifier()
True
Обычное имя переменной
>>> '私は手紙です'.isidentifier()
True
Юникод в качестве имени тоже доступен
>>> '1_name'.isidentifier()
False
Имя не может начинаться с цифры
>>> '੬_name'.isidentifier()
False
Включая все цифры юникода
>>> 'some name'.isidentifier()
False
Пробелы недопустимы
#basic
Everything you need To clean your home and car is available on our store with a $100 coupon.
Store 👇
https://temu.to/k/ueopn67ps3d
#bedroom#livingroom#furniture#homefurniture#sofa
Everything you need To clean your home and car is available on our store with a $100 coupon.
Store 👇
https://temu.to/k/ueopn67ps3d
#bedroom#livingroom#furniture#homefurniture#sofa
Everything you need to renovate your home is available on our store with a $100 coupon.
To order the product, type in the search “compressed sofa”
Store 👇
https://temu.to/k/ueopn67ps3d
#bedroom#livingroom#furniture#homefurniture#sofa