Ask Your Question
0

Capturing text within last parentheses group

asked 2018-10-24 11:36:43 -0600

gnixon gravatar image

updated 2018-10-26 12:12:03 -0600

jeff gravatar image

I have data like the following

Alexian Brothers Ambulatory Group Addison (ILARL)

I need to parse out the text between the ( ) and write it to a separate field. It cold be any number of characters. There could also be a second set of ( ) and I only need the ones at the end of the string.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2018-10-26 12:04:29 -0600

jeff gravatar image

The simplest way to accomplish this is probably via an expression evaluator, using the str:regExCapture EL function. For example, this should work (for the Field Expression):

${str:regExCapture(record:value('/text'), '.*\\((.*)\\)[^(]*$', 1)}

You can then store the result into a new field (Output Field) and use as needed.

edit flag offensive delete link more
0

answered 2018-10-26 15:20:13 -0600

gnixon gravatar image

I ended up doing this in java script, since the question spent over 24 hours in moderation. I simply do not have that kind of time to wait for help.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

2 followers

Stats

Asked: 2018-10-24 11:36:43 -0600

Seen: 25 times

Last updated: Oct 26