I\'m trying to match a part of a string between two different tokens. They might be multiple occurrences of the tokens in a string.
Sample text (tokens are italic, text
\[begin-match\]((?:(?!\[end-match\]).)*)\[end-match\]
You can try this.See demo.
https://regex101.com/r/uE3cC4/23