Parse based on regular expression

Hi all. I am new to n8n. I have a gitlab trigger that fires when a push occurs. The commit often contains information I don’t need from the developers. I need to take only the jira key from the commit. Commit example: Fixed bugs in task IT-1010. Through the regular expression …[0-9]{1,5} you can extract this key, but I don’t know how.

Hey @Pengwin4eg,

Welcome to the community :cake:

Give the below a go, Your Regex does work but I have changed it slightly so that we are more likely to match on the jira reference and not just 1-5 numbers.

1 Like

thank you so much Jon

1 Like

Jon help me I wanted to do exactly the same to truncate the name of the branch refs/heads/new-branche so that it would be only /new-branche. How to do this, can you throw off the link to the calculator?

Hey @Pengwin4eg,

New example, For fun I have done 2 ways to get it.

1 Like