[英]Regex to get a word if not wrapped by quotation
If we have: 如果我们有:
$text = 'Jame is sleeping but pretend that is "studying"';
Now i need a regex
to get all words after is
but if is not wrapped by double or single quotations. 现在我需要一个
regex
来获取所有的话后, is
,但如果不是由双或单引号包裹。
the result should be just sleeping
and not studying
. 结果应该是
sleeping
而不是studying
。
This is pretty simple actually: 实际上,这很简单:
is\s(\w+)
You can make it a bit more liberal: 您可以使其更加自由:
is\s([^\s"']+)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.