From: 7stud -- Date: 2009-09-10T14:37:22+09:00 Subject: Re: regex: multiline Ahmet Kilic wrote: > Hello, > > I am trying regex samples on this page > http://gnosis.cx/publish/programming/regular_expressions.html. > My problem is, how can I grep multiline with regex? > > This is my example; > ... > *****************************************************************************) > function TfrmExecMain.SetPrivilege(PrivilegeName: String; > Enable: Boolean): Boolean; > var > tpPrev, > tp : TTokenPrivileges; > token : THandle; > dwRetLen : DWord; > begin > ... > I want to print some parts of this. > > for example; > if function=~/\b(^function)\s+(\w+)/ > print this part===> : Boolean; > end > if line.match(/var/) and line.match(/begin/) > print this part ==> : TTokenPrivileges; > print this part ==> : THandle; > and print this ==> : DWord; > end > > How can i do it? str = <