我正在查询流入数据库,如下所示,
select * from measurement where '/cda/stats/@name' =~ /cda\/stats.*/ limit 5;
上面的查询工作正常,但是当我尝试在查询字符串中指定方括号时它不起作用,例如"/cda/stats/[name='set']
select * from mgmgrand where '/cda/stats/@name' =~ /cda\/stats[name='set'].*/ limit 5;
不确定如何在上述查询中转义方括号。
反斜杠“\”不适用于方括号。