View Single Post
Old 05-04-2025, 10:13 AM   #2
lomkiri
Groupie
lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.
 
lomkiri's Avatar
 
Posts: 169
Karma: 1497966
Join Date: Jul 2021
Device: N/A
If the title is always the same , you can
find : (Delphi [^(]+)\([^)]+\)
replace : \1

if you want to get rid of an optional space before the bracket, put :
find : (Delphi [^(]+)\s?\([^)]+\)
replace : \1
with "dot all" unchecked

If the title is always different (e.g. chapter title) you have to have a significative part, e.g. <h1> or <h1 class="myclass"> in :
<h1>Something (something else)</h1>

find: (<h1[^(]+)?\s\([^)]+\)(</h1>)
replace: \1\2
(deleting the optional space)

If you have trailing chars, like in
<h1>Something (something else), part 3</h1>
then :
find: (<h1[^(]+)?\s\([^)]+\)(.*?)(</h1>)
replace \1\2\3

Last edited by lomkiri; 05-04-2025 at 11:27 AM. Reason: regex with <h1> modified
lomkiri is offline   Reply With Quote