sam-fans - fans of the sam editor
 help / color / mirror / Atom feed
From: "James A. Robinson" <jim.robinson@stanford.edu>
To: "kim kubik" <chaotrope@jps.net>
Cc: "sam Fans" <sam-fans@hawkwind.utcs.toronto.edu>
Subject: Re: the obvious. =)
Date: Sat, 25 Mar 2000 20:51:46 -0500	[thread overview]
Message-ID: <200003260151.RAA22703@highwire.stanford.edu> (raw)
In-Reply-To: Message from "kim kubik" <chaotrope@jps.net>  of "Sat, 25 Mar 2000 15:47:54 PST."References: <01bf96b4$8a262aa0$7dc9efd1@pkwksj.sjna.corp.dom>  <01bf96b4$8a262aa0$7dc9efd1@pkwksj.sjna.corp.dom>

> >,x/^\/\*(.+\n)+ \*\/\n/ t /}\n/
>
> this just ran up against my (mis)understanding of 
> sam's regexp's. I'm sure when first using sam I did
> something similar to your example above and the
> 'greedy' little bastard (.+\n)+ would (to my way
> of thinking) eat the whole file, that is, never see
> the closing */ of the commment because the .+ should
> just keep on going.


Here's what I *think* is going on, but I'm no regex guru...  A '(.*\n)+'
would keep it going to the end of the file. With '(.+\n)+' I'm specifying
that there must be at least one character before the newline. So this
match ends at the first blank line.  I think the engine then backtracks
until it finds a match for ' \*\/' -- which is the end of the comment. I
believe the previous match of a newline ensures that it will not hit the
comments within the blocks (as those are '\n\t *').

And yes, I do space indent my comments so the '*' lines up with the
topmost one.  I thought that was in my post, though I did tab-indent
the whole block. Perhaps my mailer munged it.


Jim


  reply	other threads:[~2000-03-27  5:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-25 23:47 kim kubik
2000-03-26  1:51 ` James A. Robinson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-03-27 14:37 rob pike
     [not found] <chaotrope@jps.net>
2000-03-26 20:54 ` kim kubik
2000-03-27  3:35   ` James A. Robinson
2000-03-24 21:25 James A. Robinson

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=200003260151.RAA22703@highwire.stanford.edu \
    --to=jim.robinson@stanford.edu \
    --cc=chaotrope@jps.net \
    --cc=sam-fans@hawkwind.utcs.toronto.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).