正则替换

  1. pattern = '\s'
  2. str = "123 sdfsdf"
  3. re.sub(pattern,'',str)

正则提取

  1. re_parttern = r'[vV]\.?([0-9\.]*)'
  2. file_name_versions = re.findall(re_parttern, title) # 获取数组