[Gambas-user] Help using gb.pcre

David Villalobos Cambronero david_villalobos_c at ...43...
Tue Mar 10 22:51:42 CET 2009


Thanks Jesus I really appreciate your help.

 Regards


--
David



----- Original Message ----
From: Jesus Guardon <jguardon at ...2035...>
To: mailing list for gambas users <gambas-user at lists.sourceforge.net>
Sent: Tuesday, March 10, 2009 3:10:02 PM
Subject: Re: [Gambas-user] Help using gb.pcre

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
> 


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
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