Skip to main content

I have a string in a attribute. At the end of the string there are brackets containing one or more words. I would like the contents, including the brackets to be put into a new attribute.

 

Ex:

Attribute = "cat mouse (cheese crackers)"

Desired new attribute = "(cheese crackers)"

NOTE: sometimes there is one, two or more words with in the brackets, and I want all of them in the new field.

 

Using a RegEx (\\(((\\w]+( (\\w]*)*)\\)$) I can select that portion of the string, but I don't know how to put that portion into a new attribute.

 

Currently I have an AttributeCreator

with Attribute Value = @FindRegEx(@Value(Attribute),"\\((\\\w]+( +\\w]*)*)\\)$")

but the result is not the string, but numbers.

 

Thank you in advance for your time.

Julia

I would use the StringSearcher with regex \\(.+\\)

 

You can then specify the output attribute, or leave as _first_match.


Woohoo! Thank you!


Reply