Hi,
We need a regex compatible with Postgres regex syntax (https://www.postgresql.org/docs/current/functions-matching.html)
The two regexes we have found are for Java and they don't work in a postgres SQL.
1. Atlassian Java regex to match an issue key at https://confluence.atlassian.com/stashkb/integrating-with-custom-jira-issue-key-313460921.html
((?<!([A-Z]{1,10})-?)[A-Z]+-\d+)2. The community improved regex at https://community.atlassian.com/t5/Bitbucket-questions/Regex-pattern-to-match-JIRA-issue-key/qaq-p/233319
((?<!([A-Za-z]{1,10})-?)[A-Z]+-\d+)
We want it to run an update query using Regexp_Replace to change the project key in issue key mentions in the descriptions and the comments.
The best we have so far is this, but it fails to replace mentions like KEY-123/KEY-456, and KEY-123(something else)
Regexp_Replace(jiraissue.description, '(\s|^|\(|\"|\.|\,)KEY(-[0-9]+)([\)|\"|\.|\,]*)(?!\S)', '\1NEWKEY\2\3', 'g')
Thanks,