2013-05-09 正規表現 Python import re p = re.compile("^20([0-9]{2})$") m = p.search("2013") print m.group(1) # => 13