From: "Matthew, Graeme" Date: 2002-12-18T09:52:30+09:00 Subject: Regular Expressions This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C2A62B.6996C20C Content-Type: text/plain Hi all I have a wee problem here I have a variable that contains the contents of an entire file (actually a visual basic bas file), I am currently building a doc tool in ruby to document some systems My problem is the regex is not matching all occurrences on a while loop, it goes into a continious loop, im thinking it is resetting the starting position on each match Eg: while content =~ /(Private|Public)?\s*(sub|function)\s*(.*?)\s*\((.*?)\)(.*?)end\s+(sub|funct ion)/mi p "#$3\n" end content would be something like private function mbGetStatus(Byref rlItems as long) as Boolean end function public function gbGetName(Byref rlId as long) as string end function any ideas ? Cheers ------_=_NextPart_001_01C2A62B.6996C20C Content-Type: text/html Content-Transfer-Encoding: quoted-printable

Hi all I have a wee problem here

 

 

I have a variable that contains the contents of an = entire file (actually a visual basic bas file), I am currently building a doc = tool in ruby to document some systems

 

My problem is the regex is not matching all = occurrences on a while loop, it goes into a continious loop, im thinking it is resetting = the starting position on each match

 

Eg:

 

while  content =3D~ = /(Private|Public)?\s*(sub|function)\s*(.*?)\s*\((.*?)\)(.*?)end\s+(sub|f= unction)/mi

         = ;            = ;            = ;   p "#$3\n"

end

 

content would be something like

 

 

private function mbGetStatus(Byref rlItems as long) = as Boolean

 

 

end function

 

 

public function gbGetName(Byref rlId as long) as = string

 

 

end function

 

any ideas ?

 

Cheers

 

------_=_NextPart_001_01C2A62B.6996C20C--