Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Spanish
  4. validacion, con expresiones regulares
Forum Updated to NodeBB v4.3 + New Features

validacion, con expresiones regulares

Scheduled Pinned Locked Moved Spanish
2 Posts 2 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    solitarywolf
    wrote on last edited by solitarywolf
    #1

    hola amigos estoy intentando validar una dirección de email, con expresiones regulares pero no he conseguido buenos resultados, aquí mi código:

    {
        QRegExp exp("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,4})$");
        QRegExpValidator v(exp,this);
        QString text=ui->lineEdit->text();
        int pos=0;
        if(v.validate(text,pos)==QValidator::Invalid)
            QMessageBox::warning(this,QApplication::applicationName(),
                                 "El email no es valido.");
        else
            QMessageBox::information(this,QApplication::applicationName(),"Todo bien.");
    }

    SolitaryWolf

    1 Reply Last reply
    0
    • juankiJ Offline
      juankiJ Offline
      juanki
      Moderators
      wrote on last edited by
      #2

      Hola

      Pues realmente no tengo ni idea de expresiones regulares, sí, nunca las he usado :/

      Pero he encontrado esta web que me ha parecido, cuanto menos, interesante, hasta la he añadido a marcadores XD

      http://jarroba.com/busqueda-de-patrones-expresiones-regulares/

      Un saludo

      Intenta explicar el problema lo más claro y detallado posible. Adjunta los errores y el código que creas da el error.
      Procura escribir correctamente y sin faltas de ortografía.

      Si la duda se solucionó, por favor, marca el tema como 'solucionado'.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved