实现解析SQL文件表结构

This commit is contained in:
我才是二亮
2016-03-06 19:01:48 +08:00
parent 91cf3e6127
commit 8dcbc79cd3
4 changed files with 139 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
# -*- coding:utf-8 -*-
import re
content = "`id` mediumint(8) NOT NULL AUTO_INCREMENT COMMENT='hello',"
pattern = r'NOT(.*?)AUTO_INCREMENT'
print re.match(pattern, content.strip()).group(1)
# print(re.match(pattern, content).group(1))