One question please, I’m trying to join two regex in one; sometimes the date comes to me as dd/MM/yy (25/01/22) and in others like this “01 2022 Enero”
I’ve tried this way, but it’s not working for me, I’ve used the wildcard (?) because if it doesn’t find one of these patterns I don’t want to get an error.
Not the most elegant solution, but you should be able to just encapsulate each statement in brackets, then add the pipe symbol, as you have done: ([0-3][0-9](?:\/)[0-1][0-9](?:\/)[0-2][0-9])|([0-9]{1,2} 20\d{2} (Enero|Febrero|Marzo|Abril|Mayo|Junio|Julio|Agosto|Setiembre|Octubre|Noviembre|Diciembre))
It works perfectly, as long as both types of patterns exist, if one of the two does not exist, it gives me an error. I tried varying what you recommended, but it seems I’m doing something wrong.
Hi there @Lynx ,
Understood - If you want to check whether either side will match, you can use: If - System.Text.RegularExpression.Regex.IsMatch(YourStringValue, YourRegexPattern)
Then do you Match check on the Then side.
Hope that makes sense.
Thanks once again,
Josh