import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Example {
public static void main(String[] args) {
final String regex = "(\\bno\\b|\\bsin\\b|nunca|evit(e|a|ar)|abstene|rehui|recusa).{0,16}(inici(e|es|ar)|abr(ir|as)|hacer|hagas|hace|reali(za|ce)|levant(a|e)|subir|crear|efectu[ea]|ingreses|gener[ae]).{0,16}reclamo";
final String string = "¡el producto que compraste fue entregado ¡muchas gracias alaineduardo. importante en caso de necesitar algun garantia o ajuste de talla, debes de contactarnos directamente por este chat o llamar al %tel y te ayudaremos. evita realizar cualquier reclamos antes de contactarnos para efectos de talla, garantia o servicio para poder brindarte una mejor atencion. de nuevo muchas gracias por tu confianza. saludos si le quedo grande puedes compra un ajustador en esta liga %url seguro por accidente y mantenimiento gratis piezas marloz a solo %num . pesos en esta liga %url";
final Pattern pattern = Pattern.compile(regex, Pattern.MULTILINE);
final Matcher matcher = pattern.matcher(string);
while (matcher.find()) {
System.out.println("Full match: " + matcher.group(0));
for (int i = 1; i <= matcher.groupCount(); i++) {
System.out.println("Group " + i + ": " + matcher.group(i));
}
}
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Java, please visit: https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html