[Gambas-user] Multiline RegExp

Demosthenes Koptsis demosthenesk at ...626...
Tue Jul 26 10:54:53 CEST 2011


i have a multiline text (a text with emails) in a TextArea
and i want RegExp to return the list of emails.

How to do this?

i use

----------------
Private sRegExp As Regexp

Public Sub Form_Open()

  Me.Center

End

Public Sub btnMatch_Click()

  If IsNull(txtPattern.Text) Or IsNull(txtSubject.Text) Then Return
  
  sRegExp = New Regexp(txtSubject.Text, txtPattern.Text, 2)
  
  If sRegExp.Offset = -1 Then Return
  
  txtResults.Text = sRegExp.Text

End

----------------

and txtPattern.Text=(?i)\b[a-z0-9._%\-]+@[a-z0-9._%\-]+\.[A-Z]{2,4}\b

but i get only one result, the first one

-- 
Regards,
Demosthenes Koptsis.





More information about the User mailing list