Skip to main content
Solved

Removing Surrounding Parentheses in a Field

  • February 13, 2025
  • 3 replies
  • 80 views

jugoslaviaa
Enthusiast
Forum|alt.badge.img+6

I have a field that contains values with parentheses, like (0601310951181134359628), and I would like to remove them. The parentheses always appear once at the beginning and once at the end of the field.

I am currently able to achieve this using two StringReplacer transformers, each removing one parenthesis. However, I would like to do it in one step. I tried the recommended regex expressions from previous posts, but none of them worked.

Any suggestions?

Best answer by david_r

If you want to only remove parenthesis at the beginning and end of the string, and not inside the string:

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

david_r
Celebrity
  • February 13, 2025

You can try this:

It will remove any paranthesis (open or close) wherever inside “my_field”.

Here’s the regex for copy-paste purposes:

\(|\)


geomancer
Evangelist
Forum|alt.badge.img+59
  • Evangelist
  • February 13, 2025

You have to escape the parantheses. This works:

\(|\)

Search for ( or ). Replace with nothing.

Note that this will replace every ( and )


david_r
Celebrity
  • Best Answer
  • February 13, 2025

If you want to only remove parenthesis at the beginning and end of the string, and not inside the string: