забрать из строки то, что идет после
Здравствуйте!
есть такая строка str = user=true;auth=openid;location.href='https://vk.com/auth/jDHSHjk=089&jhGAJ99aU-_83jhASIhdisajoidsa'; как вырезать все что идет после location.href= тоесть вырезать именно это https://vk.com/auth/jDHSHjk=089&jhGA...ASIhdisajoidsa |
var str = "user=true;auth=openid;location.href='https://vk.com/auth/jDHSHjk=089&jhGAJ99aU-_83jhASIhdisajoidsa'"; var res = str.substring(str.indexOf("href='")+6, str.length-1); alert(res); |
var str = "user=true;auth=openid;location.href='https://vk.com/auth/jDHSHjk=089&jhGAJ99aU-_83jhASIhdisajoidsa'"; var result = /'([^']+)/.exec(str)[1]; alert(result); |
Часовой пояс GMT +3, время: 03:29. |