From: Shashank Date Date: 2002-12-20T14:18:40+09:00 Subject: Re: Regex Help Please This is a multi-part message in MIME format. ------=_NextPart_000_012D_01C2A7B3.487C85A0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable One way to find multiple occurrences would be: s =3D "PRIVATE function test() \n some code here \n End = function\n\nPRIVATE function testing() \n some code here \n End = function" m =3D prog.match(s) =20 while m p m[0] s =3D m.post_match m =3D prog.match(s) end "Matthew, Graeme" wrote in message=20 Lets me re-phrase, perhaps the source below (Thanks Shashank Date) = will be more clearer. now from the example you see below I need to find = multiple occurrences of the same pattern within the string, looking = below there are two function definitions, therefore I don't want it to = match the first I want it to continue until no further matching takes = place. ------=_NextPart_000_012D_01C2A7B3.487C85A0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

One way to find multiple = occurrences=20 would be:

 

     s = =3D=20 "PRIVATE function test() \n some code here \n End function\n\nPRIVATE = function=20 testing() \n some code here \n End function"
   =20 m =3D prog.match(s)
   
    while=20 m
        p=20 m[0]
        s =3D=20 m.post_match
        m =3D=20 prog.match(s)
    end

 

"Matthew, Graeme" <Graeme.Matthew@mercer.com&g= t; wrote=20 in message

Lets me re-phrase, = perhaps the=20 source below (Thanks Shashank Date) will be more clearer. now from the = example=20 you see below I need to find multiple occurrences of the same pattern = within=20 the string, looking below there are two function definitions, = therefore I=20 don't want it to match the first I want it to continue until no = further=20 matching takes place.

------=_NextPart_000_012D_01C2A7B3.487C85A0--