| regexp_extract {SparkR} | R Documentation |
Extract a specific idx group identified by a Java regex, from the specified string column.
If the regex did not match, or the specified group did not match, an empty string is returned.
regexp_extract(x, pattern, idx) ## S4 method for signature 'Column,character,numeric' regexp_extract(x, pattern, idx)
x |
a string Column. |
pattern |
a regular expression. |
idx |
a group index. |
regexp_extract since 1.5.0
Other string_funcs: ascii,
base64, concat_ws,
concat, decode,
encode, format_number,
format_string, initcap,
instr, length,
levenshtein, locate,
lower, lpad,
ltrim, regexp_replace,
reverse, rpad,
rtrim, soundex,
substring_index, translate,
trim, unbase64,
upper
## Not run: regexp_extract(df$c, '(\d+)-(\d+)', 1)