Hi Team,
Currently, I have a string that has the description of the product, here where I need to get only the start and end date of the offer.
Example input string value “Poco M4 Pro 5g(cool Blue, 64gb) 4gb ram 1Tb 6.6inch 50mp + 8mp offers Start date: 16/04/2022 End date: 20/04/2022.”
output : start date :16/04/2022
end date : 20.04.2022
Thanks in advance.
Hi @supermanPunch , Thank you for the replay, I am getting out as this System.Linq.Enumerable+d__97`1[System.Text.RegularExpressions.Match]., here I used "matchesactivity.
Hi @Majunu09
Use Matches activity and put this expression–
(?=Start date).*\d{4}
You will get the start date and end date required data
End date in output you have mentioned like this end date : 20.04.2022
If you want “.” instead of “/” just use (?<=End date:.).*\d{4} to get end date data and replace the output string’s “/” with “.”
@Majunu09 , Do you have many dates that need to be Extracted ? If there aren’t many dates for One Input, we wouldn’t require to use the Matches Activity.
If it is Required, we can Loop through the MatchCollection Output in the below way and access the Matched values :
@supermanPunch , Getting this error “Error ERROR Validation Error Compiler error(s) encountered processing expression “System.Text.RegularExpressions.Regex.Match( item,”(?<=End date:\s*)\d{2}/\d{2}/\d{4}”,RegexOptions.IgnoreCase).Value.ToString.Trim".
Value of type ‘System.Text.RegularExpressions.Match’ cannot be converted to ‘String’. Main.xaml"