Quantcast
Channel: MobileRead Forums
Viewing all articles
Browse latest Browse all 50080

Help for a regex

$
0
0
I have the following regex

Code:

<h(\d).*?>.*?</h\1>
and it works.

Now I want to replace for every occurrence of the found string the same string but prepended with a string of choice, say "<!-- title -->\n"

So, if the string found by the above regex was

Code:

<h1 class="veryhigh">lorem ipsum</h1>
it should been replaced by the string

Code:

<!-- title -->\n<h1 class="veryhigh">lorem ipsum</h1>
In other words, is there in the calibre regexes something like the expression "$&" in Perl?

Viewing all articles
Browse latest Browse all 50080

Latest Images

Trending Articles



Latest Images