Calc: Regex function

I want to extract the second position of a string delimited by - (dash) characters…

case 1
or case 2

the proper result would be
Case 1: RD2
Case 2: 2

I’ve tried to solve using paranthesis and back references but I get an error.


get Err:511

any one know how to fix this???

You need to describe the original string like this: first, any characters which not a dash (several pieces), then a dash, then the characters I need are not a dash (several pieces), then again a dash and something else until the end of the string

It will be "[^-]+-([^-]+)-.*"

To take a part of the string in parentheses, write the third parameter "$1"


Great answer - and it proves: “Every solution starts with a good problem description:slight_smile:

Thank you! Works like a charm!! :slight_smile: