I am trying to use the REGEXP_EXTRACT(string, pattern) function in Tableau 10.0. I have worked with regex before in C, R and python. Tableau just doesn't seem to be cooperating for even the simplest regex, all I can get is "Null". My data source is an Excel spreadsheet (.xlsx). I also tried using a CSV file with the same data to no avail.
Examples: Players[1] = "Ezekiel Elliott, RB" (r.e the Players dimension contains values of the format [A-z]{1,40},\s[A-Z]{2}). I am trying to capture the last two letters, which contain the player's football position (RB, QB, etc.) in a calculated field. All following simply return null:
REGEXP_EXTRACT([Players], '(?<=,\s)[A-Z]{2}')
REGEXP_EXTRACT([Players], '(?<=,\s)[A-Z]{2}')
REGEXP_EXTRACT[[Players], "[e,E]")
REGEXP_EXTRACT("Ezekiel Elliott, RB", "[e,E]")
The last two are especially troubling, as I can't even match a letter.
Any solutions, explanations of what I'm doing wrong, or even an arrow pointing in an illuminative direction would be greatly appreciated. I've consulted the reference on ICU regular expressions, http://userguide.icu-project.org/strings/regexp, but with no luck.