sam-fans - fans of the sam editor
 help / color / mirror / Atom feed
* regexps
@ 1992-12-09  4:15 Scott Schwartz
  0 siblings, 0 replies; 5+ messages in thread
From: Scott Schwartz @ 1992-12-09  4:15 UTC (permalink / raw)
  To: Sam Fans

Hmm.  No syntax for matching word boundaries?  Sigh.  That comes up a lot.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: regexps
@ 1992-12-09  6:15 Paul Haahr
  0 siblings, 0 replies; 5+ messages in thread
From: Paul Haahr @ 1992-12-09  6:15 UTC (permalink / raw)
  To: schwartz; +Cc: sam-fans

as i remember, the rules in sam for where the selection goes after an
x command that modified data were pretty vague.  the justification that
i came up with for this (which may or may not have anything to do with
the code) was the way in which all modifications which are supposed to
happen under an x// are batched and happen in a second pass.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: regexps
@ 1992-12-09  4:54 Scott Schwartz
  0 siblings, 0 replies; 5+ messages in thread
From: Scott Schwartz @ 1992-12-09  4:54 UTC (permalink / raw)
  To: Paul Haahr, sam-fans


Here's another question:

Given a file containing

foo dir foo
bar dir bar

,x/[^a-z]dir[^a-z]/s/dir/path/  yields

foo path foo
bar path bar

and leaves "r path" in the last line selected.  That's odd, because
running ,x/[^a-z]dir[^a-z]/p leaves " dir " selected, and then running
s/dir/path leaves " path " selected, as I would have expected.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: regexps
  1992-12-09  4:28 regexps Paul Haahr
@ 1992-12-09  4:38 ` Scott Schwartz
  0 siblings, 0 replies; 5+ messages in thread
From: Scott Schwartz @ 1992-12-09  4:38 UTC (permalink / raw)
  To: Paul Haahr; +Cc: sam-fans


| beginning of word:      (^|[^a-zA-Z0-9])
| end of word:            ($|[^a-zA-Z0-9])

I lust for \< and \>.  In vi, something like
	%s/\<foo\>/gnu/
is wonderfully concise.

| 'course, you still have to narrow dot by one then.  

Hey, no fair leaving parts out. :-)



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: regexps
@ 1992-12-09  4:28 Paul Haahr
  1992-12-09  4:38 ` regexps Scott Schwartz
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Haahr @ 1992-12-09  4:28 UTC (permalink / raw)
  To: schwartz; +Cc: sam-fans

beginning of word:      (^|[^a-zA-Z0-9])
end of word:            ($|[^a-zA-Z0-9])

'course, you still have to narrow dot by one then.  your definition of 
word may be different from mine, of course, so, maybe
        (^|[ \t]) and ($|[ \t])
would be more appropriate.  (i don't think sam takes \t, but it's
much clearer for purposes of the example.)


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1992-12-09  6:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1992-12-09  4:15 regexps Scott Schwartz
1992-12-09  4:28 regexps Paul Haahr
1992-12-09  4:38 ` regexps Scott Schwartz
1992-12-09  4:54 regexps Scott Schwartz
1992-12-09  6:15 regexps Paul Haahr

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