Foi testada com xHarbour.
Código: Selecionar todos
// The example uses a regular expression to detect if a character
// string is a valid eMail address.
PROCEDURE Main
Local cRegEx := "\b[!#\$%&'\*\+\-/=\?\^_`{\|}~a-zA-Z0-9][!#\$%&'\*\+\-/=\?\^_`{\|}~a-zA-Z0-9\.]*[!#\$%&'\*\+\-/=\?\^_`{\|}~a-zA-Z0-9]@[a-zA-Z0-9\-][a-zA-Z0-9\-\.]+[a-zA-Z0-9\-]\b"
LOCAL cEMail, GetList := {}
SetMode( 24,80)
CLS
cEmail := Space( 250 )
WHILE LastKey() != 27
@ 10, 10 Say "Endereco de e-mail:" Get cEmail PICT "@S30"
READ
IF RTrim( cEMail ) LIKE cRegEx
DispOutAt( 12,10, PadR( RTrim( cEMail ) + " ==> valido", 79 ) )
ELSE
DispOutAt( 12,10, PadR( RTrim( cEMail ) + " ==> invalido", 79 ) )
ENDIF
ENDDO
RETURN



