Skip to main content
Solved

How to test to find the values that contain two parentheses and extract string inside it


spiderman
Contributor
Forum|alt.badge.img+7

Hello ,

i have attribute contains may values as

streetname (park: mo (beside))

street name (park: far away )

How could I use test filter at first to find which value contains parentheses inside it ,I mean

as (beside)

which value has no parentheses inside it

then the values that include parentheses after string as ( park: mo (beside))

i would like to extract only the word beside at new attribute .

all values include parentheses ( at the beginning but I am interested in the second parentheses ,how could I get the all values that contain two parentheses then extract the string inside the parentheses as beside word .

thanks for help

FME 2021

Best answer by danilo_fme

Hi @spiderman​ 

 

Please, see this regex to identify 

\(([^()]*)\)

Match 

View original
Did this help you find an answer to your question?

5 replies

danilo_fme
Evangelist
Forum|alt.badge.img+45
  • Evangelist
  • Best Answer
  • January 15, 2023

Hi @spiderman​ 

 

Please, see this regex to identify 

\(([^()]*)\)

Match 


spiderman
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • January 15, 2023
danilo_fme wrote:

Hi @spiderman​ 

 

Please, see this regex to identify 

\(([^()]*)\)

Match 

  • That what I want ,thanks.It works great ,but how could I divide them by testfilter .i need to know which one contains two parentheses and which contain only one parentheses .

danilo_fme
Evangelist
Forum|alt.badge.img+45
  • Evangelist
  • January 15, 2023
spiderman wrote:
  • That what I want ,thanks.It works great ,but how could I divide them by testfilter .i need to know which one contains two parentheses and which contain only one parentheses .

Please, you can try to use tue custom transformer SpecificCharacterCounter.

 

SpecificCharacterCounter 

Workspace_Counter


spiderman
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • January 15, 2023
spiderman wrote:
  • That what I want ,thanks.It works great ,but how could I divide them by testfilter .i need to know which one contains two parentheses and which contain only one parentheses .

Thanks a lot


danilo_fme
Evangelist
Forum|alt.badge.img+45
  • Evangelist
  • January 15, 2023
spiderman wrote:
  • That what I want ,thanks.It works great ,but how could I divide them by testfilter .i need to know which one contains two parentheses and which contain only one parentheses .

I'm happy to help you!


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