Validate SoundCloud URL via javascript regex

function getSoundCloudInfo(url){
  var regexp = /^https?:\/\/(soundcloud\.com|snd\.sc)\/(.*)$/;
  return url.match(regexp) && url.match(regexp)[2]
}

It is too late, but...

Don't forget about:

  1. mobile version (m. after http(s)://)
  2. possible slash at the end
  3. with or without SSL/TLS, so it can be http or https
  4. with or without www

So, full regex is:

^(https?:\/\/)?(www.)?(m\.)?soundcloud\.com\/[\w\-\.]+(\/)+[\w\-\.]+/?$


((https:\/\/)|(http:\/\/)|(www.)|(m\.)|(\s))+(soundcloud.com\/)+[a-zA-Z0-9\-\.]+(\/)+[a-zA-Z0-9\-\.]+