Welcome to NodeBB madwyn!
First, remember there is no proper or correct way to do things. There may be a way the developers intend you to do things, but always use the method that makes the most sense to you.
It sounds like you want to add a field to the composer, the area where posts and topics are edited/created. This is not something I have seen plugins do before, and I don't see any hooks that would be useful for that specifically yet. In this case, you may want to examine the composer code and see where a new hook would be useful.
I tried to accomplish what you want myself, but there doesn't appear to be any non-hackish way to do it at present. A few things are missing.
- There's no way to filter what gets sent in the 'post' socket event. (No way for the server to get the extra data in any non-trivial way.)
- There's no way read the extra data should you manage to send it. (There are filters for posts, but they don't send the original data object, only the parts it wants.)
Appending the DOM with the extra input fields it rather easy once the data is in the server. You can edit the templates to use the new data, or listen for socket events and add it with jQuery.
I think you should look into where you can add the needed events in core and composer. It seems to me that you would need to rewrite a lot of code to work around the limitations I mentioned.
I'm not exactly sure what your second question is. The post content is all text, so you may be looking for string operations like match(), replace(), etc.. which use regex to select and modify the content.