[英]Regex working in C# but not in javascript
Can anyone help getting a piece of regex working in javascript please? 任何人都可以帮助获取正则表达式在javascript中工作吗?
This is the regular expression: 这是正则表达式:
storify.com\/*(?<code>[^"]*)
It works fine in C# but I can't get it working in js, I presume due to a delimiter issue but not sure which characters are causing the problem. 它在C#中可以正常工作,但是我无法在js中使用它,我想是由于定界符问题,但不确定是哪个字符引起了问题。
This is the js I'm trying but gives me and an "invalid quanitifier" error on the first line 这是我正在尝试的js,但是在第一行中给了我一个“无效的量化”错误
var myregex = /storify.com\/*(?<code>[^"]*)/;
var storify = 'http://storify.com/DigitalFirst/ces-2013-five-things-you-missed-day-3';
var remoteid = storify.match(myregex);
console.log(remoteid);
Thanks in advance for anyone who can help get this working. 预先感谢任何可以帮助您完成此工作的人。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.