Im trying to remove the 'page=?' (? = only numbers) from URL path with following method:
var urlslugRegex = '/^[a-z0-9-]+$/';
var url = window.location.href;
var lastpath = url.substring(url.lastIndexOf('/') + 1);
var lasturl = lastpath.replace('page=' + urlslugRegex, '');
but the regular expression not working. Any ideas?