Need to extract only months

Hi Team, I have to extract months count from the below text could you please help on this?.
Input: Extend Contract : 12 months; Reinstate Contracts: 261223999; effective : 09-24-2024.

Output: 12

Hi @manojmanu.rpa

Try this

(\d+)(?=\s+months)

Or

(?<=Extend Contract\s+:\s+)(\d+)(?=\s+months)

Regards,

@manojmanu.rpa

System.Text.RegularExpressions.Regex.Match(Input,"(\d+)(?=\s+months)").Value

Regards,

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