Closed antarey closed 1 year ago
There is a sqlite table
CREATE TABLE IF NOT EXISTS extention_files_detal ( source_path TEXT, source_text BLOB, extention_type INTEGER, condition TEXT, id INTEGER PRIMARY KEY ON CONFLICT ROLLBACK AUTOINCREMENT ); INSERT INTO extention_files_detal ( source_path, source_text, extention_type, condition, id ) VALUES ( '{SYSTEMNAME_ALL_LOWER}.xml', '<?xml version=''1.0'' encoding=''utf-8''?> <extension type="component" method="upgrade"> ... -cbAddDBTable{<folder>language</folder>}- .... </extension> ', NULL, NULL, 1 );
Query select regexp_replace(ed.source_text, '(-cbAddDBTable{)([\s\S]*?)(}-)', '%2') from extention_files_detal ed return
select regexp_replace(ed.source_text, '(-cbAddDBTable{)([\s\S]*?)(}-)', '%2') from extention_files_detal ed
<?xml version='1.0' encoding='utf-8'?> <extension type=""component"" method=""upgrade""> ... %2 .... </extension>
but should return
<?xml version='1.0' encoding='utf-8'?> <extension type=""component"" method=""upgrade""> ... <folder>language</folder> .... </extension>
thanks for the help
The replacement expression should be $2, not %2.
$2
%2
Sorry
There is a sqlite table
Query
select regexp_replace(ed.source_text, '(-cbAddDBTable{)([\s\S]*?)(}-)', '%2') from extention_files_detal ed
returnbut should return
thanks for the help