Regex - An Introduction (Patreon)
Content
I was having a conversation about how useful RegEx can be and it turned into an impromptu tutorial on how I'm currently using it. Sharing it here in case anyone else finds it useful.
RegEx is basically Matrix Code that can be used to identify varied patterns in text using set rules. Instead of searching for exact words or string patterns you can ask it to look for patterns that meet specific rules.
It's insanely useful in Obsidian if you want to make bulk changes in a note. Lets say you have a 1000 monster notes and you want to add a single line to each note that adds the picture where the image name is the same as the monsters name, you could do this with RegEx.
WARNING: RegEx is super dangerous. Always backup everything before you mess with this.
Here's the text file I was working with. It's the data.json file from the TTRPG Statblock plugin. I wanted to added a line into every monster startblock that contained the 'image: "monster name.png",'

So using a tool like Sublime Text or Notepad++ you can do a Find/Replace with RegEx or Regular Expression enabled.
Here's the RegEx I was using at the time stepping through what each part does. w

When I click Find using this code. It finds and highlights this text.

From there I can write another line of code that's used used in the Replace.

Note I never actually finished this task. I'm not happy with the output yet.
This is the output though. When I use this, I usually use a Folder Search which allows me to run this Find/Replace across as many notes as I like. Incredibly powerful... insanely dangerous.

This is by no means an extensive tutorial on how to use this. Instead this is designed as a way to highlight the functionality to people who probably are already comfortable with this sort of data entry and it might help them 'read the Matrix' and therefore unlock their ability to use this sort of method in the future.
If you do want to mess with this. I highly recommend learning within a restricted test environment. Both of these links offer a place to learn where you can paste some of your example text in and then practice writing the RegEx and see the results in real-time.