Skip to main content
Solved

Removing Surrounding Parentheses in a Field

  • February 13, 2025
  • 3 replies
  • 42 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:

 

View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, 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+47
  • 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:

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings