REGEX_NAMED_GROUPS
Matches the regular expression on the input string. Returns the record with field names and group names.
Syntax
Arguments
Name | Type | Description | Default Value |
---|---|---|---|
pattern | string | Regular Expression Pattern | |
allMatches | Boolean | Return all the matches of the pattern, and not only the first one | false |
filterEmpty | Boolean | Filter out empty matches | false |
input | string |
Examples
pattern | allMatches | filterEmpty | input | Output |
---|---|---|---|---|
'^(?:(?.?):/)?/?(?[^:/\s]+)(?::(?\d))?(?:(/\w+)/)(?[\w-.]+[^#?\s]+)(?:.)?$' | false | false | 'https://www.domain.com/page.html' | {scheme: |
'^(?:(?.?):/)?/?(?[^:/\s]+)(?::(?\d))?(?:(/\w+)/)(?[\w-.]+[^#?\s]+)(?:.)?$' | false | false | 'http://www.domain.com:8080/page.html' | {scheme: |
'^(?\d*)$' | false | false | '123' | {digits: |
'^(?\d*)$' | false | false | 'foo' | null |
'^(?\d*)$' | false | false | '' | {digits: ``} |
'^(?\d*)$' | false | true | '' | null |
'\bwww.(?[^.]*).com\b' | true | false | 'www.upsolver.com' | {domain: |
'\bwww.(?[^.]*).com\b' | true | false | 'www.a.com www.b.com' | [{domain: |
'\bwww.(?[^.]*).com\b' | false | false | 'www.a.com www.b.com' | {domain: |
Transformation job example
SQL
Query result
pattern | allMatches | filterEmpty | input | Output |
---|---|---|---|---|
'^(?:(?.?):/)?/?(?[^:/\s]+)(?::(?\d))?(?:(/\w+)/)(?[\w-.]+[^#?\s]+)(?:.)?$' | false | false | 'https://www.domain.com/page.html' | {scheme: |
Last updated