9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Sam: Is This a Bug?
@ 2024-10-03 21:37 kalterdev
  2024-10-03 21:55 ` umbraticus
  0 siblings, 1 reply; 3+ messages in thread
From: kalterdev @ 2024-10-03 21:37 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 754 bytes --]

Consider the following sample text:

foo
bar
baz
qux
quux

The purpose is to merge each pair of words, so that the text becomes:

foobar
bazqux
quux

The following command works fine:

x/.+\n.+/ x/\n/ d

But the following one does not:

x/.*\n.*/ x/\n/ d

It results in all \n being deleted.

I suppose it's because .* matches an empty string in this case. But
it really shouldn't. Sam's regular expressions are leftmost-longest.
And there's seemingly nothing that must stop both .* from extending.

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/Tabb641f45805a1fc-M3a459815536caaee8e5401c5
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

[-- Attachment #2: Type: text/html, Size: 1669 bytes --]

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

end of thread, other threads:[~2024-10-03 22:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-03 21:37 [9fans] Sam: Is This a Bug? kalterdev
2024-10-03 21:55 ` umbraticus
2024-10-03 22:01   ` kalterdev

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