What would be the best approach to match an optional pattern at the end of a string, after an any pattern, using Regex in Javascript? Is there a way to make an optional pattern inclusive when it comes at the end of the string and after an any pattern?
My Regex:
'{any:any}'.match(/{?(.+):(.+)}?/);
Current Result:
['{any:any}', 'any', 'any}', index: 0, input: '{any:any}', groups: undefined]
Expected Result:
['{any:any}', 'any', 'any', index: 0, input: '{any:any}', groups: undefined]