Solution [Re: Need help with narroely focused use case of Emacs]

2024-07-05 Thread Richard Owlett
On 06/29/2024 12:17 PM, to...@tuxteam.de wrote: On Sat, Jun 29, 2024 at 06:37:23AM -0500, Richard Owlett wrote: [...] When searching for information on regular expressions I came across one that did it by searching for {"1 thru 9" OR "10 thru 99" OR "100 thru 999"} . I lost the reference ;

Re: Need help with narroely focused use case of Emacs

2024-06-30 Thread mick.crane
On 2024-06-30 14:21, Greg Wooledge wrote: On Sun, Jun 30, 2024 at 12:32:15 +0100, mick.crane wrote: got it thanks. I don't know what you're trying to do, but ERE [0-7]{1,2} matches one- or two-digit *octal* numbers (e.g. 5, 07, 72, 77) but not numbers that contains the digits 8 or 9. D

Re: Need help with narroely focused use case of Emacs

2024-06-30 Thread Andy Smith
Hello, On Sun, Jun 30, 2024 at 09:21:57AM -0400, Greg Wooledge wrote: > Do you have a book whose verses are enumerated in octal? No one clarified that this was the *Christian* Bible. 😀 Thanks, Andy

Re: Need help with narroely focused use case of Emacs

2024-06-30 Thread Greg Wooledge
On Sun, Jun 30, 2024 at 12:32:15 +0100, mick.crane wrote: > got it thanks. > > > > > > > I don't know what you're trying to do, but ERE [0-7]{1,2} matches one- or two-digit *octal* numbers (e.g. 5, 07, 72, 77) but not numbers that contains the digits 8 or 9. Do you have a book whose verses

Re: Need help with narroely focused use case of Emacs

2024-06-30 Thread mick.crane
On 2024-06-29 20:29, Greg Wooledge wrote: On Sat, Jun 29, 2024 at 20:18:02 +0100, mick.crane wrote: Oh, I see what the question was. There is "use regular expressions", "use multi line matching" in Geany I'm not very good at regular expressions. I'd probably do it 3 times "search for" "search f

Re: Need help with narroely focused use case of Emacs

2024-06-29 Thread mick.crane
On 2024-06-29 20:29, Greg Wooledge wrote: On Sat, Jun 29, 2024 at 20:18:02 +0100, mick.crane wrote: Oh, I see what the question was. There is "use regular expressions", "use multi line matching" in Geany I'm not very good at regular expressions. I'd probably do it 3 times "search for" "search f

Re: Need help with narroely focused use case of Emacs

2024-06-29 Thread Greg Wooledge
On Sat, Jun 29, 2024 at 20:18:02 +0100, mick.crane wrote: > Oh, I see what the question was. > There is "use regular expressions", "use multi line matching" in Geany > I'm not very good at regular expressions. > I'd probably do it 3 times > "search for" > "search for" > "search for" There's mor

Re: Need help with narroely focused use case of Emacs

2024-06-29 Thread mick.crane
On 2024-06-29 16:09, Max Nikulin wrote: On 29/06/2024 20:07, mick.crane wrote: On 2024-06-29 12:34, Max Nikulin wrote: To manipulate with HTML it is better to write a script in some programming language, e.g. for python there are lxml etree and BeautifulSoup packages. This way it is easier to m

Re: Need help with narroely focused use case of Emacs

2024-06-29 Thread David Wright
On Sat 29 Jun 2024 at 17:08:04 (+0200), Vincent Lefevre wrote: > On 2024-06-28 20:53:50 +, Michael Kjörling wrote: > > Yes, it almost certainly can be done with a single sed (or other > > similar tool) invocation where the regular expression matches > > precisely what you want it to match. But

Re: Need help with narroely focused use case of Emacs

2024-06-29 Thread Curt
On 2024-06-29, wrote: > >> Owlett is a notorious troll who never listens to reason. > > This is wrong, borderline defamatory. Richard Owlett is not a Andy Smith: It's not an authentic Owlett thread unless it contains an enormous XY problem, a monomaniacal obsession with a solution already pa

Re: Need help with narroely focused use case of Emacs

2024-06-29 Thread tomas
On Sat, Jun 29, 2024 at 06:37:23AM -0500, Richard Owlett wrote: [...] > When searching for information on regular expressions I came across one that > did it by searching for >{"1 thru 9" OR "10 thru 99" OR "100 thru 999"} . > I lost the reference ;< That would be something like ([0-9]|[1-9]

Re: Need help with narroely focused use case of Emacs

2024-06-29 Thread tomas
On Sat, Jun 29, 2024 at 04:02:56PM -, Curt wrote: > On 2024-06-29, Michael Kjörling wrote: > >> > >> HUH ?? > > > > ..._focus on the goal_. > > > > > Owlett is a notorious troll who never listens to reason. This is wrong, borderline defamatory. Richard Owlett is not a troll [1]. He

Re: Need help with narroely focused use case of Emacs

2024-06-29 Thread Lee
Hi, > > So you may prefer to use regexes as > > Murphy intended, handling both the opening and closing tags at the same > > time, leaving the intervening text intact. > > In this particular case I suspect it would become overly complex. > I've already discovered that the order of edits is importan

Re: Need help with narroely focused use case of Emacs

2024-06-29 Thread Curt
On 2024-06-29, Michael Kjörling wrote: >> >> HUH ?? > > ..._focus on the goal_. > Owlett is a notorious troll who never listens to reason. But you people adore this kind of troll, inexplicably, perhaps because he allows you to expand endlessly on your reams of essentially useless knowl

Re: Need help with narroely focused use case of Emacs

2024-06-29 Thread Max Nikulin
On 29/06/2024 20:07, mick.crane wrote: On 2024-06-29 12:34, Max Nikulin wrote: To manipulate with HTML it is better to write a script in some programming language, e.g. for python there are lxml etree and BeautifulSoup packages. This way it is easier to maintain valid document structure with pai

Re: Need help with narroely focused use case of Emacs

2024-06-29 Thread Vincent Lefevre
On 2024-06-28 20:53:50 +, Michael Kjörling wrote: > Yes, it almost certainly can be done with a single sed (or other > similar tool) invocation where the regular expression matches > precisely what you want it to match. But unless this is something you > will do very often, I tend to prefer rea

Re: Need help with narroely focused use case of Emacs

2024-06-29 Thread Andy Smith
Hello, On Sat, Jun 29, 2024 at 01:46:27PM +, Michael Kjörling wrote: > On 29 Jun 2024 06:12 -0500, from rowl...@access.net (Richard Owlett): > >> there may be other closing tags you don't want to > >> change because they close other tags we haven't seen. > > > > Chuckle ;} The appropriate "

Re: Need help with narroely focused use case of Emacs

2024-06-29 Thread Michael Kjörling
On 29 Jun 2024 05:51 -0500, from rowl...@access.net (Richard Owlett): >> Ignoring the question about Emacs > > Emacs *CAN NOT* be ignored. I did not say to ignore _Emacs_. I said that I was ignoring the _question_ about Emacs, to instead... >> and focusing on the goal (your ^^

Re: Need help with narroely focused use case of Emacs

2024-06-29 Thread Michael Kjörling
On 29 Jun 2024 06:12 -0500, from rowl...@access.net (Richard Owlett): >>> $ for v in $(seq 1 119); do sed -i 's,>> id="V'$v'">,,g' ./*.html; done >> >> Having done that (or similar), don't forget to change the relevant >> closing tags to closing tags. However, there may be >> other closing tags

Re: Need help with narroely focused use case of Emacs

2024-06-29 Thread mick.crane
On 2024-06-29 12:34, Max Nikulin wrote: On 29/06/2024 11:48, to...@tuxteam.de wrote: Do M-x (hold Meta, most of the time your Alt key, then "x"). You get a command for a prompt. Enter "query-replace-regexp" And to get help for this function C-h f query-replace-regexp RET To open user m

Re: Need help with narroely focused use case of Emacs

2024-06-29 Thread Richard Owlett
On 06/29/2024 06:51 AM, debian-u...@howorth.org.uk wrote: Richard Owlett wrote: On 06/28/2024 03:53 PM, Michael Kjörling wrote: On 28 Jun 2024 14:04 -0500, from rowl...@access.net (Richard Owlett): I need to replace ANY occurrence of thru [at most] by I'm reforma

Re: Need help with narroely focused use case of Emacs

2024-06-29 Thread Greg Wooledge
On Sat, Jun 29, 2024 at 07:43:47 -0400, Dan Ritter wrote: > The option "g" means that said should do this multiple times if > it occurs in the same file (globally, like grep) instead of the > default behavior which is to find the first match and just > change that. The g option in sed's s command

Re: Need help with narroely focused use case of Emacs

2024-06-29 Thread Greg Wooledge
On Fri, Jun 28, 2024 at 21:23:03 -0600, Charles Curley wrote: > On Fri, 28 Jun 2024 20:53:50 + > Michael Kjörling wrote: > > > $ for v in $(seq 1 119); do sed -i 's, > id="V'$v'">,,g' ./*.html; done > > > > Be sure to have a copy in case something goes wrong; and diff(1) a few > > files afte

Re: Need help with narroely focused use case of Emacs

2024-06-29 Thread Dan Ritter
Richard Owlett wrote: > On 06/28/2024 03:53 PM, Michael Kjörling wrote: > > On 28 Jun 2024 14:04 -0500, from rowl...@access.net (Richard Owlett): > > > I need to replace ANY occurrence of > > > > > >thru [at most] > > > > > > by > > > > > > > > > I'm reformatting a Bible

Re: Need help with narroely focused use case of Emacs

2024-06-29 Thread debian-user
Richard Owlett wrote: > On 06/28/2024 03:53 PM, Michael Kjörling wrote: > > On 28 Jun 2024 14:04 -0500, from rowl...@access.net (Richard > > Owlett): > >> I need to replace ANY occurrence of > >> > >>thru [at most] > >> > >> by > >> > >> > >> I'm reformatting a Bible st

Re: Need help with narroely focused use case of Emacs

2024-06-29 Thread Richard Owlett
On 06/28/2024 11:48 PM, to...@tuxteam.de wrote: On Fri, Jun 28, 2024 at 02:04:37PM -0500, Richard Owlett wrote: Pluma is my editor of choice. *BUT* it can NOT handle Search and Replace operations involving regular expressions. I would be *very* surprised if an editor, these days and age can't

Re: Need help with narroely focused use case of Emacs

2024-06-29 Thread Max Nikulin
On 29/06/2024 11:48, to...@tuxteam.de wrote: Do M-x (hold Meta, most of the time your Alt key, then "x"). You get a command for a prompt. Enter "query-replace-regexp" And to get help for this function C-h f query-replace-regexp RET To open user manual switch to the help buffer and press

Re: Need help with narroely focused use case of Emacs

2024-06-29 Thread Richard Owlett
On 06/28/2024 10:23 PM, Charles Curley wrote: On Fri, 28 Jun 2024 20:53:50 + Michael Kjörling wrote: $ for v in $(seq 1 119); do sed -i 's,,,g' ./*.html; done Be sure to have a copy in case something goes wrong; and diff(1) a few files afterwards to make sure that the result is as you int

Re: Need help with narroely focused use case of Emacs

2024-06-29 Thread Richard Owlett
On 06/28/2024 03:53 PM, Michael Kjörling wrote: On 28 Jun 2024 14:04 -0500, from rowl...@access.net (Richard Owlett): I need to replace ANY occurrence of thru [at most] by I'm reformatting a Bible stored in HTML format for a particular set of vision impaired seniors (my

Re: Need help with narroely focused use case of Emacs

2024-06-29 Thread Richard Owlett
On 06/28/2024 02:33 PM, Van Snyder wrote: On Fri, 2024-06-28 at 14:04 -0500, Richard Owlett wrote: Pluma is my editor of choice. *BUT* it can NOT handle Search and Replace operations involving regular expressions. Emacs can. It has much verbose documentation. But examples seem rather scarce.

Re: Need help with narroely focused use case of Emacs

2024-06-29 Thread Richard Owlett
On 06/28/2024 02:17 PM, didier gaumet wrote: Le 28/06/2024 à 21:04, Richard Owlett a écrit : Pluma is my editor of choice. *BUT* it can NOT handle Search and Replace operations involving regular expressions. [...] Hello Richard, According to the Mate wiki, Pluma handles regular expressions t

Re: Need help with narroely focused use case of Emacs

2024-06-28 Thread tomas
On Fri, Jun 28, 2024 at 09:17:14PM +0200, didier gaumet wrote: > Le 28/06/2024 à 21:04, Richard Owlett a écrit : > > Pluma is my editor of choice. > > *BUT* it can NOT handle Search and Replace operations involving regular > > expressions. > [...] > > Hello Richard, > > According to the Mate wiki

Re: Need help with narroely focused use case of Emacs

2024-06-28 Thread tomas
On Fri, Jun 28, 2024 at 02:04:37PM -0500, Richard Owlett wrote: > Pluma is my editor of choice. > *BUT* it can NOT handle Search and Replace operations involving regular > expressions. I would be *very* surprised if an editor, these days and age can't do regular expressions. Really. > Emacs can.

Re: Need help with narroely focused use case of Emacs

2024-06-28 Thread Charles Curley
On Fri, 28 Jun 2024 20:53:50 + Michael Kjörling wrote: > $ for v in $(seq 1 119); do sed -i 's, id="V'$v'">,,g' ./*.html; done > > Be sure to have a copy in case something goes wrong; and diff(1) a few > files afterwards to make sure that the result is as you intended. Having done that (or

Re: Need help with narroely focused use case of Emacs

2024-06-28 Thread Michael Kjörling
On 28 Jun 2024 14:04 -0500, from rowl...@access.net (Richard Owlett): > I need to replace ANY occurrence of > > thru [at most] > > by > > > I'm reformatting a Bible stored in HTML format for a particular set of > vision impaired seniors (myself included). Each chapter is in it

Re: Need help with narroely focused use case of Emacs

2024-06-28 Thread Van Snyder
On Fri, 2024-06-28 at 14:04 -0500, Richard Owlett wrote: > Pluma is my editor of choice. > *BUT* it can NOT handle Search and Replace operations involving > regular > expressions. > > Emacs can. It has much verbose documentation. > But examples seem rather scarce. nedit can handle regular expres

Re: Need help with narroely focused use case of Emacs

2024-06-28 Thread didier gaumet
Le 28/06/2024 à 21:04, Richard Owlett a écrit : Pluma is my editor of choice. *BUT* it can NOT handle Search and Replace operations involving regular expressions. [...] Hello Richard, According to the Mate wiki, Pluma handles regular expressions the Perl way: https://wiki.mate-desktop.org/mat