🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #262862

Re: 40tude find & replace 4 characters before sending message!!!!!!

#262862
From: Frank Slootweg
Date: Sun, 09 Sep 2018 14:08
33 lines
2810 bytes
Doyun Jahng <ahngdoyun@tbroad.com> wrote:
[...]
> Syntax is same inside Linux (except Linux control+v is Windows control+q).
>
> May be you can help on gvim regexp syntax to get 1 command to work?
> On Windows gvim "vy" copies & "ga" identifies the curly character.
> 
> The problem is to convert 4 character before sending 40tude message!
>  convert open  single quote d145 to straight single quote d39 (')
>  convert close single quote d146 to straight single quote d39 (')
>  convert open  double quote d147 to straight double quote d34 (")
>  convert close double quote d148 to straight double quote d34 (")
> 
> The "digraph" percent sign (%) only work one at a time.
>  open  single quote (d145) to straight single quote (d39) -> :%s/\%d145/'/g
>  close single quote (d146) to straight single quote (d39) -> :%s/\%d146/'/g
>  open double quote (d147) to straight double quote (d34) -> :%s/\%d147/"/g
>  close double quote (d148) to straight double quote (d34) -> :%s/\%d148/"/g 
> I can not get the syntax correct to do all 4 conversion at once!
> 
> The "\d" reduce the 4 command above to 2 command:
> open/close single quote to straight single quote -> :%s/[\d145,\d146]/'/g 
> open/close double quote to straight double quote -> :%s/[\d147,\d148]/"/g 
> 
> But I can not understand yet syntax to make above to 1 command!

  Others have already given Delphi-based suggestions/solutions, which is
probably the way to go.

  As you mention gvim and Linux, I assume you might have other Unix
commands available (on Windows). If so, have a look at the tr(1)
command, 'translate or delete characters'. tr(1) is designed for these
kind of tasks and in gvim you can pipe the current text to tr(1).
Technical Details
Message-ID: <pn3ggm.bhk.1@ID-201911.user.individual.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.(126883).mbox.7z!not-for-mail
References: <pn1qed$28a6$1@adenine.netfront.net> <pn1sno$lel$1@tncsrv09.home.tnetconsulting.net> <pn1vtd$2o5f$1@adenine.netfront.net>

Show Full Headers
Complete Article Headers
Message-ID: <pn3ggm.bhk.1@ID-201911.user.individual.net>
Subject: Re: 40tude find & replace 4 characters before sending message!!!!!!
Date: Sun, 09 Sep 2018 14:08:00 +0000
From: Frank Slootweg <this@ddress.is.invalid>
References: <pn1qed$28a6$1@adenine.netfront.net> <pn1sno$lel$1@tncsrv09.home.tnetconsulting.net> <pn1vtd$2o5f$1@adenine.netfront.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.(126883).mbox.7z!not-for-mail
Newsgroups: news.software.readers
Organization: NOYB
Lines: 33
X-Trace: individual.net cLZXcnDgjXZBFtSfVU0f6gCLFD+WHVHVemyuMCLyR9XTX+g351
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:XIF44zbJRtGsuPxQkKNL5MTNTWU=
User-Agent: tin/1.6.2-20030910 ("Pabbay") (UNIX) (CYGWIN_NT-6.3-WOW/2.8.0(0.309/5/3) (i686)) Hamster/2.0.2.2
X-Antivirus: Avast (VPS 180909-2, 09/09/2018), Outbound message
X-Antivirus-Status: Clean
X-Received-Bytes: 2691
X-Received-Body-CRC: 828660775