Re: AW: Find a value , and insert it at the begining of line

"'c.willis111 ' via vim_use" <[email protected]> Tue, 26 May 2026 18:21:00 +0100 (BST)
Newsgroups gmane.editors.vim
Message-ID <[email protected]>
------=_Part_686676_1416890333.1779816060703
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: quoted-printable


=C2=A0
------ Original Message ------
From: [email protected]
To: [email protected]
Sent: Tuesday, May 26th 2026, 17:54
Subject: AW: Find a value , and insert it at the begining of line
A little shorter would probably be :%s/\(.*\)\(18\d\d\)\(.*\)/\2&/ (But=20
since you haven't provided input samples and corresponding expected=20
output I'm not sure and you will have to confirm it.) Janis=20
________________________________________ Von: 'c.willis111 ' via vim_use=20
Gesendet: Dienstag, 26. Mai 2026 18:06 An: [email protected]=20
Betreff: Find a value , and insert it at the begining of line Hi this=20
works. Is there a niftier way? (ie without capturing the context).=20
:%s/\(.*\)\(18\d\d\)\(.*\)/\2\1\2\3/ It seems that the nested capture=20
which wd have been a tad shorter, doesn't work. regards - Chris -- --=20
You received this message from the &quot;vim_use&quot; maillist. Do not=20
top-post! Type your reply below the text you are replying to. For more=20
information, visit http://www.vim.org/maillist.php --- You received this=20
message because you are subscribed to the Google Groups=20
&quot;vim_use&quot; group. To unsubscribe from this group and stop=20
receiving emails from it, send an email to=20
[email protected]. To view this discussion visit=20
https://groups.google.com/d/msgid/vim_use/483eb624.1c088.19e6509f0f5.Webtop=
.140%40btinternet.com=20
<https://groups.google.com/d/msgid/vim_use/483eb624.1c088.19e6509f0f5.Webto=
p.140%40btinternet.com>
=C2=A0
Thanks Janis, and particularly Tim. I keep forgetting about &.
=C2=A0
regards - Chris. -- -- You received this message from the=20
&quot;vim_use&quot; maillist. Do not top-post! Type your reply below the=20
text you are replying to. For more information, visit=20
http://www.vim.org/maillist.php --- You received this message because=20
you are subscribed to the Google Groups &quot;vim_use&quot; group. To=20
unsubscribe from this group and stop receiving emails from it, send an=20
email to [email protected]. To view this discussion=20
visit=20
https://groups.google.com/d/msgid/vim_use/DU0PR02MB104223044573EC3CE5325CB5=
FF30B2%40DU0PR02MB10422.eurprd02.prod.outlook.com.

--=20
--=20
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---=20
You received this message because you are subscribed to the Google Groups "=
vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/vim_use/288=
d3ac2.1c3eb.19e654dd762.Webtop.140%40btinternet.com.

------=_Part_686676_1416890333.1779816060703
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<p>&nbsp;</p><blockquote><p>------ Original Message ------<br>From: janis_p=
[email protected]<br>To: [email protected]<br>Sent: Tuesday, May=
 26th 2026, 17:54<br>Subject: AW: Find a value , and insert it at the begin=
ing of line<br>A little shorter would probably be :%s/\(.*\)\(18\d\d\)\(.*\=
)/\2&amp;/ (But since you haven't provided input samples and corresponding =
expected output I'm not sure and you will have to confirm it.) Janis ______=
__________________________________ Von: 'c.willis111 ' via vim_use Gesendet=
: Dienstag, 26. Mai 2026 18:06 An: [email protected] Betreff: Find a=
 value , and insert it at the begining of line Hi this works. Is there a ni=
ftier way? (ie without capturing the context). :%s/\(.*\)\(18\d\d\)\(.*\)/\=
2\1\2\3/ It seems that the nested capture which wd have been a tad shorter,=
 doesn't work. regards - Chris -- -- You received this message from the "vi=
m_use" maillist. Do not top-post! Type your reply below the text you are re=
plying to. For more information, visit http://www.vim.org/maillist.php --- =
You received this message because you are subscribed to the Google Groups "=
vim_use" group. To unsubscribe from this group and stop receiving emails fr=
om it, send an email to [email protected]. To view this =
discussion visit <a target=3D"_blank" rel=3D"noopener noreferrer" href=3D"h=
ttps://groups.google.com/d/msgid/vim_use/483eb624.1c088.19e6509f0f5.Webtop.=
140%40btinternet.com">https://groups.google.com/d/msgid/vim_use/483eb624.1c=
088.19e6509f0f5.Webtop.140%40btinternet.com</a></p><p>&nbsp;</p><p>Thanks J=
anis, and particularly Tim. I keep forgetting about &amp;.</p><p>&nbsp;</p>=
<p>regards - Chris<https: groups.google.com=3D"" d=3D"" msgid=3D"" vim_use=
=3D"">. -- -- You received this message from the "vim_use" maillist. Do not=
 top-post! Type your reply below the text you are replying to. For more inf=
ormation, visit http://www.vim.org/maillist.php --- You received this messa=
ge because you are subscribed to the Google Groups "vim_use" group. To unsu=
bscribe from this group and stop receiving emails from it, send an email to=
 [email protected]. To view this discussion visit https:=
//groups.google.com/d/msgid/vim_use/DU0PR02MB104223044573EC3CE5325CB5FF30B2=
%40DU0PR02MB10422.eurprd02.prod.outlook.com.</https:></p></blockquote>

<p></p>

-- <br />
-- <br />
You received this message from the &quot;vim_use&quot; maillist.<br />
Do not top-post! Type your reply below the text you are replying to.<br />
For more information, visit <a href=3D"http://www.vim.org/maillist.php">htt=
p://www.vim.org/maillist.php</a><br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;vim_use&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">vim_use+uns=
[email protected]</a>.<br />
To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/=
vim_use/288d3ac2.1c3eb.19e654dd762.Webtop.140%40btinternet.com?utm_medium=
=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid/vim_use/288=
d3ac2.1c3eb.19e654dd762.Webtop.140%40btinternet.com</a>.<br />

------=_Part_686676_1416890333.1779816060703--