JavaScript get url segment and parameter
<p>I've read some question but I still can't figure out how to do it<br>
I have a url <code>example.com/event/14aD9Uxp?p=10</code>  </p>

<p>Here I want to get the <code>14aD9Uxp</code> and the value of p<br>
I've tried using <code>split('/'+'?p=')</code> but it doesn't work<br>
I want to use regex but I dont really understand how to use it</p>