Solved

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

  • 15 January 2023
  • 5 replies
  • 1 view

Badge +3

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

icon

Best answer by danilo_fme 15 January 2023, 12:04

View original

5 replies

Userlevel 4
Badge +30

Hi @spiderman​ 

 

Please, see this regex to identify 

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

Match 

Badge +3

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 .
Userlevel 4
Badge +30
  • 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

Badge +3
  • 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

Userlevel 4
Badge +30
  • 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!

Reply