[Gambas-user] Help using gb.pcre
Jesus Guardon
jguardon at ...2035...
Tue Mar 10 22:10:02 CET 2009
Hi David
This is what I did:
PUBLIC FUNCTION chkEmail(sEmail AS String) AS Boolean
DIM bMail AS Boolean
DIM regx as Regexp
IF sEmail THEN
regx =
NEW Regexp(sEmail,"(?i)\b[a-z0-9._%\-]+@[a-z0-9._%\-]+\.[A-Z]{2,4}\b")
IF regx.Text THEN
'DEBUG regx.Text
bMail = TRUE
ELSE
bMail = FALSE
ENDIF
ENDIF
RETURN bMail
END
I your text matches, it will return true.
Sorry for ugly indentation due to plain text formatting email.
Jesus
David Villalobos Cambronero escribió:
> Hi, I need to match some regular expresions, I think I can use Gambas to do it, in the documentation says somethig like this:
>
>
> (?i)\b[a-z0-9._%\-]+@[a-z0-9._%\-]+\.[A-Z]{2,4}\b
>
>
> But how can I use it, any idea?
>
> Any help need thanks.
> Regards
>
>
> --
> David
>
>
>
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
More information about the User
mailing list