You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
@m1lt0n or @hanzei would you know who can help with this question? I don't know if there is a more accurate tool to use a a reference for how the plugin evaluates the expressions.
It is not obvious from the documentation, but when all options DisableNonWordPrefix, DisableNonWordSuffix, and WordMatch are disabled (which is the case if they are not shown in the /autolink list output), autolink modifies the pattern as seen in the Compile function.
Your regex becomes (?P<MattermostNonWordPrefix>(^|\s))(?P<project_id>\w+)(-)(?P<jira_id>\d+)(?P<MattermostNonWordSuffix>$|[\s\.\!\?\,\)]) - see https://regex101.com/r/fC8DaU/1 with your example
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.The text was updated successfully, but these errors were encountered: