why not `pn = url.match(/\bdocid=([^&#]*)/)[1]`? (Also this would throw if the match fails, but I guess it's fine, since this shouldn't normally happen and we would want to investigate if it does)