I need a RegEx expression that can extract the text inside parantheses but only if a specific text pattern is met. If more than one set of parantheses exists it should only be the text in the last set that should be looked at.
The validation rule should be 1-3 three letters in the beginning and 1-3 numbers at the end of the text inside the parantheses.
(ABC 123) Text string (DEF 456)
Result: DEF 456
(ABC 123) Text string (DEFG 123)
Result: DEFG 123
(ABC 123) Text string (DEFG ABC)
(ABC 123) Text string (123)
(ABC 123) Text string (ABC DEF 123)
Result: ABC DEF 123
This is what I have so far:
But if I use the RegEx on example 1 it will return “ABC 123” from the first set of parantheses. Also it does not support any text between the first three letters or last three digits.
Any idea on how to get around this?