Syntax to match a specific project mentioned in the description using the .match command in A4J
Asked by Dave Furlani:

For linking all issues in the a specific project mentioned in the description I figure I should use the .match command. For me it's the IFIP project.

To reduce false-positives, I use the regex \[1-9\]\[0-9\]{0,7} to ensure the first digit isn't a 0, and there's up to 8 digits in total after the project key.

With or without the quotes, this fails to put a value into the ifipTicket smart variable (see screen shot). I think the single curly braces are an issue, but they are correct regex syntax.

```
{{issue.description.match("\b(IFIP-[1-9][0-9]{0,7})\b")}}
```

The same regex syntax correctly identifies the Jira key in a filter step (see attachment), but provides a null string when used in the .match

What am I doing wrong? Do I need to escape the single curly braces, or have I just plain missed something?

![download.png](https://community.atlassian.com/t5/image/serverpage/image-id/321062iACC9185527B2D3E1/image-size/large?v=v2&px=999 "download.png")

![download.png](https://community.atlassian.com/t5/image/serverpage/image-id/321064i212EB075F663720B/image-size/large?v=v2&px=999 "download.png")

![download.png](https://community.atlassian.com/t5/image/serverpage/image-id/321007iCD6A82E8CAAC2161/image-size/large?v=v2&px=999 "download.png")![download.png](https://community.atlassian.com/t5/image/serverpage/image-id/321008i4337389839ED5203/image-size/large?v=v2&px=999 "download.png")


Answers:
author: Bill Sheboy
body: Hi [@Dave Furlani](/t5/user/viewprofilepage/user-id/5112923)

I suspect that one, or more, of the regular expression constructs you are using may not be supported. As the documentation states, with emphasis added by me:
> The underlying implementation **is based on** Java's Pattern class and uses Matcher.find() to find matches.

<https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#match-->

I recommend starting with the simplest expression that can possibly meet your needs, testing that, and then incrementally adding more constructs until it stops working. That will identify the problem and allow making adjustments.

This could also be the parsing order of the match() function, which I have seen solved before by first saving your regular expression in a variable, without quotation marks, and then using it in the match as:

{{issue.description.match(varRegEx)}}

My quick testing showed word-boundary worked and that {0,7} did not, even with escaping the curly brackets.

Kind regards,  
Bill

comments: author: Dave Furlani
body: Using your regex in a variable idea I've got this working. The curly braces did indeed cause an issue, as did several other regex syntax until I landed on this in the variable I named theRegex:

```
"\b(IFIP-[1-9][0-9]?[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?)\b"
```

The ifipTicket variable then uses the following:

```
{{issue.description.match(theRegex)}}
```

The result is the/each IFIP ID, twice, which I then split and get the distinct vale(s) from.

```
{{ifipTicket.split(", ").distinct}}
```

I now need to split that and iterate through to add links to each IFIP ID, which for anyone trying to do something similar, is done like this:  
![0b790c85-49bf-4fe0-903b-30a8bcf24beb.png](https://community.atlassian.com/t5/image/serverpage/image-id/321240iFB08AC2AD60519B6/image-size/large?v=v2&px=999 "0b790c85-49bf-4fe0-903b-30a8bcf24beb.png")