正则表达式
^[^?#]+\?([^#]+)
Python代码
import re
matchobj = re.compile(r'''(?i)^[^?#]+\?([^#]+)''')
subject = 'http://www.regexcookbook.com?param=value'
match = matchobj.search(subject)
if match:
print match.group(1)
正则表达式
^[^?#]+\?([^#]+)
import re
matchobj = re.compile(r'''(?i)^[^?#]+\?([^#]+)''')
subject = 'http://www.regexcookbook.com?param=value'
match = matchobj.search(subject)
if match:
print match.group(1)