Try
url.match(/[?&]c=([^&]*)/)[1]
var url = "www.test.com/t.html?a=1&bc=3&c=m2-m3-m4-m5";_x000D_
_x000D_
c= url.match(/[?&]c=([^&]*)/)[1];_x000D_
_x000D_
console.log(c);
_x000D_
This is improvement of Daniel Sokolowski answer Jun 27 '19. Regexp explanation
[?&]
first matched character must be ?
or &
(to omit param like ac=
)c=
name of parameter with =
char at end(...)
match in first group[^&]*
zero or more characters ( *
) different (^
) than &
[1]
choose first group from array of matches