Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用正则表达式选择 POST/GET 参数列表?例如:
request.POST.regex(/^inputs_/)
import re input_keys = [key for key in request.POST if re.match(r"^inputs_", key)]
也就是说,这里的正则表达式将是矫枉过正的:
input_keys = [key for key in request.POST if key.startswith("inputs_")]