Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
^(?<![\s\S\r])(.*)
/
gm
Input 1
# project1 I could have put any other inline tag or string there. This main body line could have been the very first line as well, if no tags exist. Change the keys after each `\n` and add or remove any more keys you want. In this example, I added the desired tag in the indented multi-line format favoured by Obsidian. If it is a first time doing regex changes, make a backup of vault or Diary folder.
Substitution
---\ntags: \n - m/diary\n---\n\n$1
# project1 I could have put any other inline tag or string there. This main body line could have been the very first line as well, if no tags exist. Change the keys after each `\n` and add or remove any more keys you want. In this example, I added the desired tag in the indented multi-line format favoured by Obsidian. If it is a first time doing regex changes, make a backup of vault or Diary folder.