Метод строки isidentifier() поможет узнать, подходит ли данная строка в качестве имени объекта.
Вполне может заменить самостоятельно придуманную регулярку.
>>> 'some_name'.isidentifier()
True
Обычное имя переменной
>>> '私は手紙です'.isidentifier()
True
Юникод в качестве имени тоже доступен
>>> '1_name'.isidentifier()
False
Имя не может начинаться с цифры
>>> '੬_name'.isidentifier()
False
Включая все цифры юникода
>>> 'some name'.isidentifier()
False
Пробелы недопустимы
#basic
Binance Futures,#BSB Launches Its Permanent Contract
▪️ The USDⓈ-margined BSB permanent contract will be launched on the platform on March 25, 2026.
▪️ The current market value of BSB is recorded as approximately $17 million.
🚀 Back to Back profits are made in the Premium Group
🎯🎯#BSB/USDT has covered all the target to give a Profit of 470% to all Premium Members
👁🗨Contact @futurechief to enter the Premium Futures & SPOT Group for daily gain