Skip to content

Instantly share code, notes, and snippets.

@shau-lok
Created November 21, 2017 13:44
Show Gist options
  • Save shau-lok/ec291e05bd5512bfa3b7c16506da2983 to your computer and use it in GitHub Desktop.
Save shau-lok/ec291e05bd5512bfa3b7c16506da2983 to your computer and use it in GitHub Desktop.
Regular Expression -正则表达式
import
# 匹配3到6个数字
re.findall('\d{3,6}', words)
# 匹配 reservation_grid$ctl06$lnkcancel
words= "javascript:__doPostBack('reservation_grid$ctl06$lnkcancel','')"
re.findall('\(\'(.*)\',\'',href)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment