I'm picking up a bit here to mount the Regex of a pattern I put together, which would be this:
ALTERAC[AO,OES] [DE] CADASTRO[S] [-] SOCIAL
What is between [ ]
is what can vary. The doubt is that in the words "DE" and "-" may or may not have, so I wanted to ignore them. I have tried in many ways but it is not going out as needed.
Here is the code I put up:
using System;
using System.Text.RegularExpressions;
public class Program
{
public static void Main()
{
string texto = "alteracao de cadastro social";
//string texto = "alteracao de cadastro - social";
//string texto = "alteracoes de cadastro social";
//string texto = "alteracao cadastro social";
//string texto = "alteracao cadastro - social";
bool passou = (new Regex(@"(a)(l)(t)(e)(r)(a)(c)(ao|oes)( )(de)( )(c)(a)(d)(a)(s)(t)(r)(o|os)( )(-)(s)(o)(c)(i)(a)(l)").IsMatch(texto));
Console.WriteLine(passou);
}
}