extractParseAnchor
Compare a pattern (custom regex) to a string then return the Nth token, where N is specified as part of the input. This function improves readability of a pattern that contains only '*'. It doesn't do extensive regex.
Usage Details
LQL Command
select extractParseAnchor(column, pattern, '$N') as resultCol from table
Input:
table
: Input table.
pattern
: Parameter, a custom regex pattern like "logic_com" (same as "^logic._com$" in Java).
column
: Column name to match pattern.
$N
: Extract Nth token.
Output:
Returns Nth token
Example
Input
table
sourcePort |
---|
'A emil B logic C' |
'A test B util' |
LQL command
select *, extractParseAnchor(col, 'A * B * C', '$2') as a result from table
Output
sourcePort | result |
---|---|
'A emil B logic C' | emil |
'A test B util' | test |