I have an data.url string. I want to get some data from it with the following regex
var filename = data.url.match(/file=(.+)&/gi);
All I want is the data inside the parenthesis -a file name actually- but what I get back is "file=example.jpg&". Why is this happening? Shouldn't only the the matches found in the parentheses be returned? How can I get rid of those unnecessary characters? Thanks