[Gambas-user] Multiline RegExp

Jesus ea7dfh at ...2382...
Wed Jul 27 22:46:21 CEST 2011


El 27/07/11 12:53, Demosthenes Koptsis escribió:
> Thanks Ian!
> 
> It would be more easy the RegExp to return an Array of results like grep
> returns all the matches of multiline text.
> 
> 
> On Wed, 2011-07-27 at 20:13 +1000, Ian Haywood wrote:
>> On Wed, Jul 27, 2011 at 5:34 PM, Demosthenes Koptsis
>> <demosthenesk at ...626...> wrote:
>>
>>> 2) The Pattern i use is:
>>> (?i)\b[a-z0-9._%\-]+@[a-z0-9._%\-]+\.[A-Z]{2,4}\b
>>>
>>> 3) The result is only one email:
>>> dimos at ...146...
>>>
>>> and not the rest of them.


If I am not wrong, it would be possible by using .RegexpSubmatches
virtual class. It returns an array of sub-matches against your pattern
on a given subject.

The only thing you must do is to enclose your entire regexp between
parenthesis.

By the way, I didn't test it.

Regards
-- 
Jesus




More information about the User mailing list