Article View: news.software.readers
Article #264610Re: [40tude] Edit -> Find regular expression?
From: VanguardLH
Date: Tue, 19 Jan 2021 08:41
Date: Tue, 19 Jan 2021 08:41
71 lines
3711 bytes
3711 bytes
mike <this@address.is.invalid> wrote:
> When searching for a character to replace in 40Tude Dialog, is there a
> way to search for more than one disjoint character at a time?
>
> As an example I might want to replace all starting left side curly
> doublequotes and all ending right side curly doublequotes with
> straight doublequotes.
>
> Can the 40Tude Dialog "Edit -> Find" be made to see both types of
> opening and ending doublequotes at the same time to replace both
> types with straight quotes in a single Find command?
Why do you think Dialog's Edit -> Find function has a replace operation?
It just finds. It does not replace. To replace means another field
would have to be included to show with just what to replace the found
substring. Edit -> Find has only one input field: "Text to find".
There is no "[Text to] replace with" field.
Or do you mean you'll use the Find function, and then manually edit the
found string? You could do a regex search using:
“.*”
The dot (.) means any character, and the * means zero, or more, of any
character. The above would find:
“”
“X”
“abc def. Right you are!”
However, regex rules are plain text, so you won't be able to add the
curly quotes to a rule. You'll need to use the encoded or numeric value
for the characters. My recollection is regex in Dialog uses the PCRE
variant.
https://www.regular-expressions.info/unicode.html
You would have to replace the curly quotes with their Unicode
equivalents. From the above article, PCRE does not handle \uFFFF to
specify the hexidecimal number for a Unicode character. Instead you use
\x{FFFF} (include the curly braces).
201C = left curly quote character
201D = right curly quote character
So, my guess is you would use the following regex to find (not replace)
any string of zero, or more, characters where the order is left curly,
followed by zero or more characters, followed by a right curly, and
probably looks like:
\x{201C}.*\x{201D}
Since all the headers are ASCII characters (I think there is some
encoding prefix identifier for the Subject header, but the string itself
is all ASCII), you must be trying to find the curly quoted strings in
the body of message. Make sure when you use Edit -> Find that you
select the "Article body pane" tab in the Find dialog.
I don't know of any posts that use the double curly quote characters,
but as a test I did a Find on the straight double quote characters, like
the "Edit -> Find" string in your post. I opened the Find dialog,
selected the "Article body pane" tab, and searched on:
\x{0022}.*\x{0022}
0022 is the hex Unicode value of the double straight quote ("). It
found your string in your post. I could've used " to make it easier,
but I wanted to test using the Unicode encoded format to specify the
straight double quote character.
Technical Details
Message-ID:
<3xo0b6k69bco$.dlg@v.nguard.lh>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mailReferences:
<ru5nfg$si7$1@solani.org>Show Full Headers
Complete Article Headers
Message-ID: <3xo0b6k69bco$.dlg@v.nguard.lh> Subject: Re: [40tude] Edit -> Find regular expression? Date: Tue, 19 Jan 2021 02:41:35 -0600 From: VanguardLH <V@nguard.LH> References: <ru5nfg$si7$1@solani.org> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail Content-Transfer-Encoding: 8bit Newsgroups: news.software.readers Cancel-Lock: sha1:ghiFD0qpFNqmpKVPO95X5aUFMcs= Lines: 71 Mime-Version: 1.0 Keywords: VanguardLH VLH811 Content-Type: text/plain; charset="iso-8859-13" X-Received-Bytes: 3598 X-Trace: individual.net uCs/l0LwkmiCWI509GcQfwp9Neo8CznX8oe+ZDQYEwCLB/ux75 Organization: Usenet Elder User-Agent: 40tude_Dialog/2.0.15.41