Consider my humble hello.html
file, edited with mighty ed:
$ ed hello.html 28 ,p <title>Hello world!</title>
What's your general approach to edit inside that title HTML tag (bonus if you can edit inside any HTML tag)?
I tried a regular expression that matches inside the tag:
s/>.*/>My new title/p <title>My new title u . <title>Hello world!</title>
But, sadly, you can see that I chopped my tag (and it would be way too much work to type out that </title>
bit every time!).
For further education, I browsed through Software Tools in Pascal page to 174—see https://archive.org/details/softwaretoolsinp00kern/page/174/mode/1up?view=theater page—and discovered the &
special character that helpfully reaches the middle of the sentence:
s/world/& again/p <title>Hello world again!</title>
But, that's not quite right, since I want to substitute the middle, not just reach the middle.
s/>[^>]*</>My new title</
, but you'd have to provide some representative input and output for us to say what might work.