Get url parameter and save variable or cookie Get url parameter and save variable or cookie wordpress wordpress

Get url parameter and save variable or cookie


I'm not sure if this is all you wanted. But, here is the regex to match alphanumeric characters after '/'

Tested and works for both mysite.com/123456 and mysite.com/somename

/(?<=mysite.com\/)\w+/