标签: regex
我想匹配一个包含int,space和一个单词包含以下foo|bar|apple中的至少一个的文本。例如,使用以下输入:
int
space
foo|bar|apple
int fooAmount 123 int bar123 int appleXXX 4 foo.ToUpper()
我要提取:
int fooAmount int bar123 int appleXXX
我已经管理过类似的东西:
(?=int \b\w*foo|bar|apple\w*\b)
但是似乎无法正常工作。有什么想法吗?