标签: java regex
我有这个字符串
null,"category":"Cooking \u0026 Baking Needs","nonInteraction":true}
这个正则表达式:\"category\":\"([^"]*)\"
\"category\":\"([^"]*)\"
哪个匹配此"category":"Cooking \u0026 Baking Needs"
"category":"Cooking \u0026 Baking Needs"
但是,我只需要捕获Cooking \u0026 Baking Needs(不带引号)
Cooking \u0026 Baking Needs
我的正则表达式缺少什么?
答案 0 :(得分:0)
您可以使用此(?<=\"category\":\")([^"]*)(?=\")
(?<=\"category\":\")([^"]*)(?=\")
Online demo