Regex function to create new column
| QuestionID | QuestionCAT |
| CR067Q01T | CR |
| S067Q01T | S |
I am trying to create a new column with the following formula in the "QuestionCAT" column:
Regex (QuestionID, "[a-zA-Z]*")
However, the formula does not seem to work for JMP Pro Version 13.0. Does anyone know what is the issue?
Re: Regex function to create new columnIn your example, CR067Q01T matched the CR and stopped at the zero. What do you need it to match? If you need to remove all the digits, something like this might work:
regex("CR067Q01T", "\d+", "", GLOBALREPLACE)
"CRQT"
blog post on regex
update: also, you might want +, rather than *, for the repetition. * means zero or more and + means one or more. [A-Z]* will match zero letters at the beginning of "123ABC", which might not be what you want. [A-Z]+ will advance past the digits in order to get at least one letter, then get all three.