create cursor foundAddresses (fromRec i, address m) goRegEx = Createobject("VBScript.RegExp") goRegEx.Pattern = "\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" goRegEx.ignoreCase = .T. goRegEx.Global = .T. select emails scan FindAddress(emails.content, recno('emails')) endscan select foundAddresses browse Procedure FindAddress(tcString, tnRecno) loMatches = goRegEx.Execute(m.tcString) FOR EACH loMatch IN loMatches insert into foundAddresses ; (fromRec, address); values ; (m.tnRecno, loMatch.Value) ENDFORUpdate: I might have misunderstood your requirement. It might be like:
goRegEx = Createobject("VBScript.RegExp") goRegEx.Pattern = '(from=\"(\w+([-+.]\w+)*)@aaa.com\")|(to=\"(\w+([-+.]\w+)*)@bbb.com\")' goRegEx.ignoreCase = .T. goRegEx.Global = .T. append from myText.txt type sdf for goRegEx.Test( content )Cetin