I have the following regex in the tool Obsidian-to-Anki Plugin I use, taken from their Wiki:
^Q: ((?:.+\n)*)\n*A: (.+(?:\n(?:^.{1,3}$|^.{4}(?<!<!--).*))*)
Source: https://github.com/Pseudonium/Obsidian_to_Anki/wiki/Question-answer-style
Description for this Plugin:
The above styles are but a few examples of the endless possible styles you can make using regular expressions. If you want to make your own style, however, you should know these things:
The script automatically compiles the regular expression with a 'multiline' flag, so you can use the ^ character to signal the beginning of a line
You need to have as many capture groups in your regexp as there are fields in the note type - the 1st capture group becomes the 1st field, the 2nd becomes the 2nd field etc
If making a 'paragraph' regex, consider using this group to match lines at the end - (?:^.{1,3}$|^.{4}(?<!<!--).*)). It ensures that you don't accidentally match the <!-- at the start of an ID comment!
Source : https://github.com/Pseudonium/Obsidian_to_Anki/wiki/Regex
So in Obsidian i have to write sth like that (copied from the source):
Q: How do you use this style?
A: Just like this.
Q: Can the question
run over multiple lines?
A: Yes, and
So can the answer
Q: Does the answer need to be immediately after the question?
A: No, and preceding whitespace will be ignored.
Now, the problem of this is, i can NOT add Text between Q: and A:, which should NOT be detected. So i want to have sth like that:
Q: This is my question
This is my second line of my question and my question will end when i use this 3 dots, but i dont have to use it, if no additional text is between Q: & A: °°°
This is additional text on a new line, which should not be detected as a part of my question or answer, nor should it destroy the functionality.
A: This is my Answer.
My second line of the Answer °°° This is additional Text on the same line, which should not be detectet as my Answer. So as you can see, it should be possible to make an additional text on the same line, but also on a new line.
Is there someone, who can help me with that ?
I did try this: (A:)(.*)(°°°)(.*)(B:)(.*)(°°°)(.*)
This does not work in Obsidian.
When i write that...
A: This is my Question °°° and this is additional Text B: This is my answer
...then my Question will be "A:" and my answer will be "This is my question".
I also tried that: (A:)(.*)(?:°°°)(B:)(.*)(?:°°°)(.*)
This does completly not work. So it does not make a flashcard.