View on GitHub

JODA - JSON On Demand Analysis

Efficient data wrangling for semi-structured JSON documents

REGEX_REPLACE - String

Replaces all matches of regexp in str with replace

Details

Note: “\” have to be escaped in JODA strings

Input parameters

Name Type Optional Description
str String False String in which to replace
regexp String False Regular expression
replace String False String with which to replace

Output

String: str with all matches replaced by replace

Usage

REGEX_REPLACE(<str>, <regexp>, <replace>)

Examples

Example 1

Query

LOAD tmp
AS ('': REGEX_REPLACE("Number: 345345 Other: 2343", "(\\d+)", "<number>"))

Result

"Number: <number> Other: <number>"