REGEXPARSE
Description
Extracts parts of a string by matching to a pattern.
Syntax
REGEXPARSE(
text
,
regex
, [
ignore_case
])
- text: The text to parse.
- regex: The regular expression.
- ignore_case: If TRUE, the function ignores case when searching. If FALSE, the function considers case. The default is FALSE.
Example
Formula | Result |
|---|---|
=REGEXPARSE("[Los Angeles]","\[(.*)\]") | Los Angeles |
=REGEXPARSE("12-OCT-2015","(\d\d)-([A-Z]{3})-(\d{2,4})") | 12-OCT-2015
12
OCT
2015
|
=INDEX(REGEXPARSE("aa;bbbbbb24;cccc;","(.*?);(.*?);.*"),3)
Extracts
the nth part of a delimited string | bbbbbb24 |
Notes
- This function returns an array of values where each value is part of the string where it found a pattern match. This function is useful if you have a pattern and you want to pull out the parts of the text that matched the pattern.
- This function is intended for use in array formulas. You submit array formulas with special keyboard shortcuts. We recommend that you use the unconstrained keyboard shortcut Ctrl+Alt+Enter (on Windows) or Command+Option+Enter (on Mac) so Worksheets can use all the cells it needs for the results. For more information, see Reference: Array Formula Keyboard Shortcuts.
- Workday uses Java's regular expression parser; the expression must conform to Java's regex rules (http://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html) .