Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/474.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 查找匹配到http的字符串_Javascript_Regex - Fatal编程技术网

Javascript 查找匹配到http的字符串

Javascript 查找匹配到http的字符串,javascript,regex,Javascript,Regex,我需要从`Speak获取字符串,直到找到a\n和http。我需要 这是{{document advantage}}去的地方,这是{{remove fourth}去的地方 然后是:{删除最后两个}}然后我们将有{{标准时间} 另外,{{删除可选小部件}}。还有{{标准列表} 结果呢 这就是我尝试过的。但是用它来得到以h结尾的字符串 [Ss]peak(+.+)([\s\s]+?)(\n[http]|$)根据测试字符串测试此正则表达式: # Example Agreement `Purpose` Y

我需要从`Speak获取字符串,直到找到a\n和http。我需要

这是{{document advantage}}去的地方,这是{{remove fourth}去的地方

然后是:{删除最后两个}}然后我们将有{{标准时间}

另外,{{删除可选小部件}}。还有{{标准列表}

结果呢

这就是我尝试过的。但是用它来得到以h结尾的字符串


[Ss]peak(+.+)([\s\s]+?)(\n[http]|$)

根据测试字符串测试此正则表达式:

# Example Agreement

`Purpose` You give a short description.

`Party 1 Name` Seller

`Party 2 Name` Buyer

Speak This is the place where {{document advantage}} goes and this is where {{remove fourth}} goes.  

Then there is this: {{remove last two}}  Then we will have {{standard time}}.

Also, {{remove optional widgets}}.  Then there is also {{standard list}}.

https://github.com

(?=http)
部分是正向前瞻,它断言字符串末尾的
http
如下。

请分享您的努力。所以不是免费站点获取代码。请练习正则表达式,特别是查看正面外观,以解决您的问题。@Rajesh添加了我尝试过的正则表达式。@Eddi您可以分享正则表达式,因为我在创建这些正则表达式时遇到了问题。使用了积极的lookaheads,但无法在此处实现
([Ss]peak(.|\r|\n)*?(?=http))