Regular expression, how to match the contents of the string specified below?

there is a string txt file in which I want to match 123456 of the id=123456, that is, the parameter in url. There are more than 400 url, matching expressions in this txt.


python has a module to parse url

url_base = "http://www.baidu.com?id=123&name=name&passwd=passwd"
url_obj = urlparse(url_base)
query_obj = parse_qs(url_obj.query)
print query_obj
print query_obj['id']
print query_obj['name']
print query_obj['passwd']

output

{'passwd': ['passwd'], 'id': ['123'], 'name': ['name']}
['123']
['name']
['passwd']

\?id=(\d+)

var str = `
https://segmentfault.com/q/1010000016617094?id=123
https://segmentfault.com/q/1010000016617094?id=456
`;
str.match(/(?<=id=)\d+/g);
//["123", "456"]
Menu