Split value and get the first value in an excel(Always the value need to be picked before the last '-')

For example the input is

IRCT/CN/23-24/003-228845
IR24-246-229248
IR424870001-228882

The output should be

CT/CN/23-24/003
24-246
424870001

@sathish_moorthy

Welcome tot he community

please try this regex

(?<=IR).*(?=-)

System.Text.RegularExpressions.Regex.Match(str,"(?<=IR).*(?=-)").Value

cheers

1 Like

@sathish_moorthy

MathhedCollection=System.Text.RegularExpressions.Regex.Match(Input,“(?<=IR).*(?=-\d{5,})”)

Datatype:IEnumerable of Match

Use For Loop to Iterate Over the collection

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