I have a bunch of strings that look like this: '../DisplayPhotod6f6.jpg?t=before&tn=1&id=130'
, and I'd like to take out everything after the question mark, to look like '../DisplayPhotod6f6.jpg'
.
s/\(.\.\.\/DisplayPhoto.\{4,}\.jpg\)*'/\1'/g
This regex is capturing some but not all occurences, can you see why?