There are several ways to do it with regexes. In the examples below, I’m assuming your string above is in variable
1.) Extract the first 4 digit number:
2.) Extract the first 4 digit number that’s between 1900 and the current year.
a.) Get all 4 digit numbers in the string like this
b.) Create a For Each loop iterating over type
System.Text.RegularExpressions.Match c.) In the loop, assuming the item in the For Each activity is set to Item
, create an If activity with condition CInt(Item.Value) >= 1900 AndAlso CInt(Item.Value) <= CInt(Now.ToString(yyyy))`
d.) If the condition is met, extract the value in a separate value, and use a Break activity to leave the loop.
There are other ways of going about it, but the complexity will depend on how complex your string can be.