9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Andrew Simmons" <andrew@mbmnz.co.nz>
To: 9fans@cse.psu.edu
Subject: [9fans] Sam / text search query
Date: Wed, 19 Jun 2002 09:06:08 +1200	[thread overview]
Message-ID: <3D104980.16646.51DF597@localhost> (raw)

> 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.




             reply	other threads:[~2002-06-18 21:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-18 21:06 Andrew Simmons [this message]
2002-06-19 15:37 ` Douglas A. Gwyn
  -- strict thread matches above, loose matches on Subject: below --
2002-06-20 18:58 David Gordon Hogan
2002-06-21 15:00 ` Douglas A. Gwyn
2002-06-20 16:21 rog
2002-06-19 16:08 rog
2002-06-20 15:47 ` Douglas A. Gwyn
2002-06-18 17:31 Gerry Tomlinson
2002-06-18  5:07 rob pike, esq.
2002-06-18  5:03 Andrew Simmons
2002-06-18 15:03 ` Douglas A. Gwyn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D104980.16646.51DF597@localhost \
    --to=andrew@mbmnz.co.nz \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).