Regex Matching String

HI guy,

I want to use regex to delete this string, but only the certain have been delete…
Need help,.
Below is the example of string.

Sin Ma Chicken Roast (c4vu)
The Real Akka Shop (RAS) Flagship (lo4n)
Punjab Grill (erc7)
Nasi Kandar Kota Lama Horizon Hills (j4bh)
Wan Tan House Johor Jaya (h6xa)
Bachelor Cafe Taman Sri Skudai (x7gn)
BURGER REZEKI 9 BERADIK (awsb)

The string I want to delete is all (…) in the back which contain word and number.

Thanks.

Hi @Amin

You can use replace activity for this to replace data with “” using regex pattern

Use the below regex pattern.

(?<=[(]).*(?=[)])

Hi @NIVED_NAMBIAR

I want delete only 4 last word/digit.

Example
FROM:
Ming Zhen Chicken Rice (Six Star Food Court) (i4oz)
TO:
Ming Zhen Chicken Rice (Six Star Food Court)

I have use your regex, unfortunately, it match all the string in the ()

Thanks.

1 Like

@Amin - Please try the below pattern…

image

1 Like

Hi @prasath17,

you can try this,

  • Use matches activity and pass your input and pass the pattern as image

  • get output like outMatches, then to get (i4oz) do this outMatches(0).Groups(1).Value

  • use this syntax to replace the string
    inputStr.Replace(outMatch(0).Groups(1).Value,"")

Cheers
@Amin

Hi @prasath17

It’s worked!!

thanks.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.