#!user/bin/env python
#-*- coding:utf-8 -*-

import re

all=re.compile('(\d+\.\d+[eE][-+]?\d+|\d+\.\d+|[1-9]\d*|0[0-7]+|0x[0-9a-fA-F]+|[a-zA-Z_]\w*|>>|<<|::|->|\.|\+=|\-=|\*=|/=|%=|>=|<=|==|!=|&&|\|\||\+|\-|\*|/|=|>|<|!|^|%|~|\?|:|,|;|\(|\)|\[|\]|\{|\}|\'|\")')

mth=all.findall('1+3.4-sin(6)-y*pi')

print mth

#输出结果
#['1','+','3.4','-','sin','(','6',')','-','y','*','pi']

相关文章:

  • 2022-12-23
  • 2021-07-07
  • 2022-01-18
  • 2022-02-26
  • 2022-01-17
  • 2021-08-09
  • 2022-12-23
猜你喜欢
  • 2021-10-07
  • 2021-11-03
  • 2021-07-14
  • 2022-12-23
相关资源
相似解决方案