You can use this code:
find: <h2>(.*?)</h2>
replace: <h2>\L\1\E</h2>
where \L means lowercase (begin) and \E means end (of transformation)
a thoughtful use of digital
You can use this code:
find: <h2>(.*?)</h2>
replace: <h2>\L\1\E</h2>
where \L means lowercase (begin) and \E means end (of transformation)
It could be very difficult using regex in Kate, if you have php files that have still an html (and not php) as content structure.
In this case you can try to use, al filter, not *.php, but *.*.
Moreover it could be necessary to use this regex code for multiline tags :
<style type="text/css">((.|\n)*?)</style>
or
<script type="text/javascript">((.|\n)*?)</script>
and so on.
With KRename in Dolphin you can use this code
_(\d{9})
so that you can replace
name_2025-12-07_075701289.avif
with -> name_2025-12-07.avif
To replace a paragraph <p> of less than x characters (30 in the example below) with a title (<h3> in the same example), you can use this regex code
search: <p>(.{0,29})</p>
replace: <h3>\1</h3>
To mean one letter, such as ‘a’ or ‘G’, you can use [A-z].
I.g. if you want find any occurrence of strings such as 7956A, 5476H, 3865V, you can use
\d\d\d\d[A-z]
To find only a single digit (such as “1”, or “2”) and replace (only) it, you have to add a plus after \d.
Something like:
(\d+)
(to find it) and
\1
to replace it.
For example you have to add a new element to these lines
1 some first text
3 some other text
8 other text
You can use this regex
find: (\d+) replace: \n\1
as a result you will get
1 some first text
3 some other text
8 other text
You can search for
^(.*)(\r?\n\1)+$
Don’t worry: all the duplicate lines will be selected, but not all deleted. Then give this as replace
\1
If you have en ebook that split badly a paragraph, you can try (to merge the bad splitted paragraph), as find
</p>\n\n\s\s<p>([a-z])
so that a paragraph beginning with a lowercase word be merged with the previous one.
But in Calibre editor you must check “case sensitive”, otherwise [a-z] will be read as [A-Z], and all first letters (lower and upper case) will be selected.
And as replace you could try
\1
In this way you keep whatever letter is found with ([a-z]) in the result.
It can happen that you want replace a double space before <p>: use the \s. I.g. to replace
,</p>
<p>
You should use this find: ,</p>\n\n\s\s</p>
If you would replace all <p>[some digits, such as "10", or "23", or "348"]</p>, you could use this regex code:
search: <p>(.*?\d{2})</p>
replace: <h6>\1</h6>
Indeed (.*?) is whatever, and (.*?\d{2}) is whatever number (with more than two digits).