Quote:
Originally Posted by Keeth
Quote:
Originally Posted by Doitsu
Find:<h4 id="sigil_toc_id_(\d+)">(.*?)</h4>
Replace:<h3 id="sigil_toc_id_\1">\2 \1</h3>
|
That looks very interesting. Would you mind explaining what each bit is actually doing? I am not familiar with the regex codes...
|
I's a fairly simple expression and I'm pretty sure that the Regex gurus who read the posts in this forum will come up with a much more efficient one.
The search expression
(\d+) searches for one or more numbers. (Putting it in brackets allows it to recycle the match as
\1 in the replace statement.)
The search expression
(.*?) searches for any sequence of characters. Since it's the second bracketed expression, whatever matches it, can be referred to as
\2 in the replace statement.
There are lots of
Regex tutorials that explain all of this in much more detail, and there's also a
Sigil Regex subforum.