Regex and matches

I have made a match with “\d{2}-[A-z]{3}-\d{2,4}” getting correct date from string, and now I try to use assign and this expression:

to check that the string starts or contain a date like 05-NOV-19, but I got a compiler error.
Any one who can tell me whats wrong?
If the string don’t contain the date I don’t need it.


i hope this expression would help you

IF(system.text.regularexpression.Regex.IsMatch(inputstring,“\d{2}-[A-Za-z]{3,10}-\d{2,4}”),system.text.regularexpression.Regex.Match(inputstring,“\d{2}-[A-Za-z]{3,10}-\d{2,4}”).ToString, String.Empty)

Cheers @kare.smorvik

How to use it in Uipath? myArray return strings that start with a date, and som does not. I only want to read those who start with a date and pass if the string start with text.
string (0) 15-NOV-19 This is first teststring
string (1) 15-NOV-19 This is second teststring
string (2) This is also a teststring
string (3) 15-NOV-19 This is third teststring
Could be moore strings and I don¨t know witch that’s missing date.
Have tried string contains, string start and some other methods. I guess IF is only way, but I don’t get it right.