This PCRE/Boost compatible regex quickie can be used in environments that do not allow match manipulations (e.g. callbacks as replacement arguments in regex replace functions). This video demonstrates how you can confine regex matches to a certain context between two different characters. If you have mutlicharacter strings, you would use a tempered greedy token. Regex fiddle: https://regex101.com/r/JQgrEW/2 FURTHER LINKS: Notepad++ Remove \s in between brackets: https://stackoverflow.com/a/40008832/... Tempered greedy token: https://stackoverflow.com/a/37343088/...