出现常量后跟任何字符串直到空格或字符串结尾的正则表达式

RegEx for occurrence of a constant followed by any string up to a whitespace or end of string

我正在寻找出现 "data/" 后跟任何字符串直到空格或字符串结尾的正则表达式?

2 * data/color * 8 - finds "data/color"
2 * data/coloring * 8 / 34 - finds "data/coloring"
color plus 22 data/credit -- finds "data/credit"

尝试了一些例子;

data/[^\S]+\s
data/[^\S]+(\s|^)
data/\w+\s
data/\w+(\s|^)

感谢您帮助在 LUA (corona SDK) 中找到解决方案;

data\/[^\t ]+

由于某些原因我必须具体说明不能使用“\s”;

data\/[^\s]+  , fails

space 之前的任何事情都将如下所示:data\/[^\s]+

data + /(转义 /)+ [^\s]+(除了 space 1 次或多次)

https://regexr.com/4c8cr