bottle正则表达式匹配

1
2
3
4
5
6
7
8
9
10
from bottle import route, run
import re


@route('/re/<num:re:[0-1]*>')
def getbinary(num=0):
return num
#匹配2进字符串
#匹配失败则返回404
run(port=8088, debug=True, reloader=True)

转载请注明来源 https://tianweiye.github.io