正则表达式求教
本帖最后由 yaoyuchiccccc 于 2013-01-17 14:18:53 编辑
player = new YKU.Player('youkuplayer', {
client_id: '214165a1256f249b',
vid: 'XNTAyNzk4Mzcy',
show_related: false
});
取出vid的值 XNTAyNzk4Mzcy
------解决方案-------------------- string str = File.ReadAllText("D:\\1.txt", Encoding.Default);
str = Regex.Match(str, @"(?<=vid:\s*[""'])[^""',\s]+(?=[""'])").Value;
------解决方案--------------------@"(?i)(?<=vid:\s*')[^']+"