The task is the following - you need to create a regular expression that checks the URL, and if it has the format https://vk.com/[0-9A-z._] , but NOT https://vk.com/album[0-9] give the desired result.
var value = document.getElementById('name').value; var regex = /^https:\/\/vk.com\/^album\d(\d\w){1,100}+$/; if( regex.test(value) ) alert('ok'); else alert('fail'); does not work. tell me what I'm doing wrong?
/^https:\/\/vk\.com\/(?!album-?\d)[^\/]*$/? Or^https:\/\/vk\.com\/(?!album-?\d)[^\/\s]*$? - Wiktor Stribiżew