From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Andrew Simmons" To: 9fans@cse.psu.edu MIME-Version: 1.0 Subject: [9fans] Sam / text search query Message-ID: <3D104980.16646.51DF597@localhost> Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Date: Wed, 19 Jun 2002 09:06:08 +1200 Topicbox-Message-UUID: b35257a2-eaca-11e9-9e20-41e7f4b1d025 > this is the easiest way > > ,x g/sprintf/ .,/.*msgprint.*\n/ p > >it seems easy to me, almost a transcription of what you're asking to >do. > >if you have multiple sprintfs before msgprint, though, you might >prefer this: > > ,x g/msgprint/ ?.*sprintf.*\n?,.p > >subtler but maybe more correct; your specification was ambiguous. Brilliant, thanks. Your second method is exactly what I wanted, your first the best I was expecting. Would that it seemed as easy to me, but my brain locks up and turns to custard when faced with regular expressions beyond a minimal level of complexity.