[Gambas-user] Multiline RegExp
Bruce Bruen
bbruen at ...2308...
Wed Jul 27 00:34:22 CEST 2011
On 26/07/11 18:24, Demosthenes Koptsis wrote:
> 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
>
>
regexp only (ever) works on a line by line basis
More information about the User
mailing list