From a tag like this:
<a name="Introduction"></a><h1><span class="mw-headline" >Introduction</span></h1>
I'd like to make:
<a name="Introduction"></a><h1><span class="mw-headline"
id="Introduction" >Introduction</span></h1>
Therefore I do the following replacement:
Match:
<a name="([A-Za-z0-9 ?_.]+)"></a><h([123])>[^mw]*mw-headline" >([A-Za-z0-9 ?_.]+)</span></h[123]>
And replace it with:
<a name="\1"></a><h\2><span class="mw-headline" id="\1" >\3</span></h\2>
This works when using a find and replace editor which accepts regex. But I can't seem to fit it in one
sed command.