Obtener el mail de una cadena de texto en PL/SQL

Wednesday, February 22, 2012 14:10
Posted in category Oracle
-- Proposito  : Devuelve un email dentro de una cadena de texto.
    -------------------------------------------------------------------------------
     FUNCTION get_email_from_texto (v_texto IN  VARCHAR2) RETURN VARCHAR2 IS
      v_email VARCHAR2(500);
     BEGIN
        SELECT REGEXP_SUBSTR(v_texto,'([a-zA-Z0-9_+*$%\^&!\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9:]{2,4})+')
          INTO v_email
        FROM dual;
        RETURN v_email;
        EXCEPTION
                WHEN OTHERS THEN RETURN NULL;
     END;
You can leave a response, or trackback from your own site.

Leave a Reply