Can I get an explanation as to why this regex works (?P<project_id>\w+)(-)(?P<jira_id>\d+)?
It's suggested to use https://regex101.com to test but testing with it matches on all sorts of things that I don't want it to, mainly destroying links, https://regex101.com/r/XPUAgu/4
Now on Mattermost it works how I want it to, but how is https://regex101.com or any other website/knowledge I have access to supposed to help me write a regex for this plugin?
If I write a regex that does work on https://regex101.com (?P<pre>\s|^)(?P<number>KEY-\d{1,4}) https://regex101.com/r/axJv7b/1 it then fails to match properly in Mattermost and also has issues displaying the regex.

Can I get an explanation as to why this regex works

(?P<project_id>\w+)(-)(?P<jira_id>\d+)?It's suggested to use https://regex101.com to test but testing with it matches on all sorts of things that I don't want it to, mainly destroying links, https://regex101.com/r/XPUAgu/4
Now on Mattermost it works how I want it to, but how is https://regex101.com or any other website/knowledge I have access to supposed to help me write a regex for this plugin?
If I write a regex that does work on https://regex101.com
(?P<pre>\s|^)(?P<number>KEY-\d{1,4})https://regex101.com/r/axJv7b/1 it then fails to match properly in Mattermost and also has issues displaying the regex.