str='filename=1817616353&realname=Arguments%20for%20&%20against%20protection%20.pdf&code2=pds'
ptn='(?<=realname=).+(?=&)'
re.search(ptn,str).group()
well, when i run this code i'm expecting to get
'Arguments%20for%20'
as the match, but instead it gives me
'Arguments%20for%20&%20against%20protection%20.pdf'
i thought the match should occur at the first occurrence of '&'
, which is right after 'for%20'
part, so i have no idea why it's going all the way down to 'pdf'
. what am i doing wrong?