|| apoc.text.regexGroups - APOC 核心文档 - Neo4j 文档

apoc.text.regexGroups

详情

语法

apoc.text.regexGroups(text, regex)

描述

返回给定文本中与给定正则表达式匹配的所有组。

参数

名称

类型

描述

text

STRING

用于提取匹配项的文本。

regex

STRING

要匹配的正则表达式模式。

返回

LIST<ANY>

使用示例

RETURN apoc.text.regexGroups(
  'abc <link xxx1>yyy1</link> def <link xxx2>yyy2</link>',
  '<link (\\w+)>(\\w+)</link>'
) AS output;
结果
输出

[["<link xxx1>yyy1</link>", "xxx1", "yyy1"], ["<link xxx2>yyy2</link>", "xxx2", "yyy2"]]

RETURN apoc.text.regexGroups(
  'Michael: 1234\nJennifer: 5678',
  '(\\w+): (\\d+)'
) AS output;
结果
输出

[["Michael: 1234", "Michael", "1234"], ["Jennifer: 5678", "Jennifer", "5678"]]

© . This site is unofficial and not affiliated with Neo4j, Inc.