voraa,
<pre>
<script>
const rs = /^\s*?(?=\t+[ ]*\S)/mig;
let s2 = '\n\t \n\t\t Журнал'
document.writeln(s2.replace(rs, '').replace(/\t/g, 'T').replace(/\s/g, 'S'))
let s3 = '\n\t\n\t\tЖурнал'
document.writeln(s3.replace(rs, '').replace(/\t/g, 'T').replace(/\s/g, 'S'))
let s4 = ' \t \t\tЖурнал'
document.writeln(s4.replace(rs, '').replace(/\t/g, 'T').replace(/\s/g, 'S'))
</script>
</pre>