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. It has much verbose documentation. > But examples seem rather scarce. Of course, Emacs is the best editor out there, by a long shot. But learning it is a long and panoramic road. You should at least have a rough idea that you want to take it. > I need to replace ANY occurrence of > <span class="verse" id="V1"> > thru [at most] > <span class="verse" id="V119"> > by > <sup> > > I'm reformatting a Bible stored in HTML format for a particular set of > vision impaired seniors (myself included). Each chapter is in its own file. > > How do I open a file. Two ways of skinning that cat: - in a terminal, type "emacs <yourfilename>" - in an open Emacs instance (be it terminal or GUI, your choice), type C-x C-f (hold CTRL, then "x", while holding CTRL then "f"). You get a prompt in the bottom line (the so-called minibuffer), enter your file name there. You get tab completions. Then there are menus... > Do the above replacement. Go to the top of your buffer (this is what you would call "your file": Emacs calls the things which hold your text while you are on them "buffers"). 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" (you get tab completions, so "que" TAB "re" TAB should suffice, roughly speaking). Enter the regular expression you're looking for. Then ENTER, then your replacement. > Save and close the file. To save, C-x C-s. I don't quite know what you mean by "close". To quit Emacs, C-x C-c. Now I don't quite understand what you mean above with your example, and whether it can be expressed by a regular expression at all, but that is for a second go. First, find out whether your beloved Pluma can deliver. I'm sure it can. Unless you want to embark in the Emacs adventure (very much recommended, mind you, but not the most efficient path to your problem at hand). Cheers -- t
signature.asc
Description: PGP signature