正则表达式从 solr FQ 本地标签中获取值

Regex to get value from solr FQ local Tag

本文关键字:标签 获取 solr FQ 正则表达式      更新时间:2023-09-26

>我正在使用 Aajx Solr 进行建筑应用,现在正在尝试在有效的刻面选择中应用加法,FQ 值也可以附加到面包屑上。

问题是我只想在面包屑中显示值

即。

 fq: "{!tag=places}places:'"usa'";  // Printing Value in breadcrumbs  "{!tag=false}places:"usa"

"

{!tag=organisations}organisations:''"abcefg''"; 面包屑中的打印值 "{!tag=organisations}organisations:"abcefg"

我只想打印值喜欢

"

{!tag=organisations}organisations:''"abcefg''"; 面包屑"abcefg"中的印刷价值 "{!tag=places}places:''"usa''"; 面包屑"美国"中的印刷价值

如何从 fq 中转义"{!tag=organisations}organisations:",只有我希望引用值应该返回。

我试过

fq[i].toString

().replace('organisations', '').replace('{', '').replace('}', '').replace('!', '').replace('=', '').replace('false', '').replace('"', '').replace('"', '').replace('"', '');

但它不是获取报价值的正确方法

此方法可以使用哪种正则表达式模式,请建议

试试这个:

((?<=(''"))(['w]+)(?=''")|(?<=")(['w]+)(?="))

您可以在此处查看它在测试表达式上的操作:

http://rubular.com/r/tL7QvpxrKx