Hi,

I think it's a typo in the cheat sheet; at least for s///,
\i is the correct syntax to reference "tagged patterns":

  % echo foo bar | ssam 's/([a-z]+) ([a-z]+)/\2 \1/'
  bar foo

I lack familiarity with sam/sam's language to be certain,
but I doubt it'd make much sense to have it for other
commands; sam(1) describes it for s/// only.

>From a quick glance, there seems to be other "typos" in
the cheat sheet[0]:

  s/"([ˆ"]*)"/‘‘1’’/      replace "hello" with ‘‘hello’’ in selection
   /(.+0+/       matches blocks of text separated by blank lines

Cheers,

[0]: http://9p.io/sources/contrib/steve/doc/sam-refcard.pdf


On Thu, Aug 22, 2024 at 5:18 AM <kalter...@gmail.com> wrote:

> # substitute #'th tagged pattern
>
>
> Are there any examples? I can't find any in Pike's papers.
> *9fans <https://9fans.topicbox.com/latest>* / 9fans / see discussions
> <https://9fans.topicbox.com/groups/9fans> + participants
> <https://9fans.topicbox.com/groups/9fans/members> + delivery options
> <https://9fans.topicbox.com/groups/9fans/subscription> Permalink
> <https://9fans.topicbox.com/groups/9fans/Tc2ebea6bfef26073-M8aa6c884325788677721755e>
>

------------------------------------------
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tc2ebea6bfef26073-Mb5cced754d2a118bfb58d449
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

Reply via email to