Skip to main content
Solved

Reges expression problem

  • January 13, 2023
  • 3 replies
  • 29 views

spiderman
Contributor
Forum|alt.badge.img+7

Hello ,

I am not sure how to use Regex expression

First example :

street name 34 (56)

street name 56 ( 44 )

street name 55(70) or street name 55( 70 )

I would like to extract the number between parentheses and add - before the number

so it should be street name 34 - 56

 

second example :

street name 56 (text)

street name 40 ( text )

street name 10(text)

street name 40( text )

i would like to extract the text between parentheses and create it in new column

 

third example :

street name 20 ( GdR 20 )

street name 22 (23-50)

I would like to extract it and add - before the value in parentheses

So it should be street name 20 - GdR 20

thanks in advance

FME 2021

Best answer by danilo_fme

Thanks .ur idea is simple and really good .

but I have at the same attribute ,

as example street name 12 (gfsjj dhl) or

street name (fhjk)

I would like to keep the values before parentheses

and remove parentheses and the rest .

so Output will be street name 12 instead of street name 12 (gfsjj dhl)

How could I achieve it ?

Hi @spiderman​ 

 

If you want to delete word with parentheses, you can use this Workspace attached.

Workspace_1 

Thanks in Advance,

Danilo

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

danilo_fme
Celebrity
Forum|alt.badge.img+51
  • Celebrity
  • 2077 replies
  • January 13, 2023

Hi @spiderman​ 

 

I created a Workspace that replacer the ( ):

 

Attribute_ 

Please, see the Workspace attached.

 

Thanks in Advance,

Danilo


spiderman
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • 64 replies
  • January 14, 2023

Hi @spiderman​ 

 

I created a Workspace that replacer the ( ):

 

Attribute_ 

Please, see the Workspace attached.

 

Thanks in Advance,

Danilo

Thanks .ur idea is simple and really good .

but I have at the same attribute ,

as example street name 12 (gfsjj dhl) or

street name (fhjk)

I would like to keep the values before parentheses

and remove parentheses and the rest .

so Output will be street name 12 instead of street name 12 (gfsjj dhl)

How could I achieve it ?


danilo_fme
Celebrity
Forum|alt.badge.img+51
  • Celebrity
  • 2077 replies
  • Best Answer
  • January 15, 2023

Thanks .ur idea is simple and really good .

but I have at the same attribute ,

as example street name 12 (gfsjj dhl) or

street name (fhjk)

I would like to keep the values before parentheses

and remove parentheses and the rest .

so Output will be street name 12 instead of street name 12 (gfsjj dhl)

How could I achieve it ?

Hi @spiderman​ 

 

If you want to delete word with parentheses, you can use this Workspace attached.

Workspace_1 

Thanks in Advance,

Danilo