RegEx expression from excel file

Hi all,

Could you please help me with a RegEx expression for extracting a company name from this:

"EXPERT SOLUŢII PUBLICITARE SRL
J03/825/2010
ROONRC.J03/825/2010
27325144

Municipiul Curtea de Argeş, Str. MIOARELE, Nr. 2, Județ Argeş"

The company name is EXPERT SOLUŢII PUBLICITARE SRL and can be found always on the forst row. Or if we can find a pattern for the expression that contains two “/” .

I have attached an excel with data that needs to be cleaned.
Thank you.

data.xlsx (9.0 KB)

@paul.baltag1 are you sure company name will be present in first line.

Can you share us the output also @paul.baltag1

Yes, always will be in the first line.

@paul.baltag1 so please use string split with new line, you will get string array and company name will be present in array first index.

Hi @paul.baltag1

How about this expression?

System.Text.RegularExpressions.Regex.Match(YourString,"(\S.+)\n[A-Z]\d+\/\d{0,5}").Groups(1)

Regards
Gokul

Thank you, it works.

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