[英]regex match a word after a particular word
I created a regex for matching a string which could be possibly something like shown below: 我创建了一个正则表达式来匹配一个字符串,它可能类似于以下所示:
then "hello I am here" blah blah
or 要么
then hello blah blah
I am trying to match the word just after then
. then
我正试图匹配这个词。 For above strings the expected outputs are 对于上述字符串,预期输出为
"hello I am here" //if the words are in quotes
or 要么
hello
I tried this regex "(\\w*[\\s]*)*"|(?<=\\bthen\\s)(\\w+)
, which is working fine online but showing error in firefox. 我尝试了此正则表达式
"(\\w*[\\s]*)*"|(?<=\\bthen\\s)(\\w+)
,该函数在网上正常运行,但在firefox中显示错误。 Error 错误
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.