我在 javascript 中使用这个正则表达式有问题:
(?<= Received: )(.*?)(?=; )
我正在尝试匹配两个字符串之间的所有内容,在这种情况下,在“Received:”和“;”之间。
这是我的代码:
var someString = "BlaBlaBla Received: blablabla; BlaBlaBla"
var receivedString = someString.match(/(?<= Received: )(.*?)(?=; )/);
但是对于第二行,我在 firebug 中遇到错误:
Error: invalid quantifier
Source Code:
var receivedDateString = dates.match(/(?<= Received: )(.*?)(?=; ));
非常感谢您的帮助。