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.
the result should be just sleeping
and not studying
.
This is pretty simple actually:
is\s(\w+)
You can make it a bit more liberal:
is\s([^\s"']+)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.