Issue Navigation Regex for Trac

Im trying to setup the issue navigation functionality in IDEA 8.0

We use Trac, and the URL format for issues is:

https://trac.server.com/trac/ticket/3709

In our checkin comments, we typically write comments like this:

#3709 - blah blah blah

We also reference other tickets within the checkin comment, so it would be nice if I could link those references as well.

I entered a Regex of [0-9]+ and this matches every number in the description (which is not perfect, since it picks up years, times etc.).

What Regex do I need to match "#[0-9]+" (since the leading # is an important clarifier here) but drop the leading # character before it gets passed in to the URL?

There is no inbuilt help for this - clicking on the help button raises the following error:
"Help topic "project.propVCSSupport.Issue.Navigation" not found.


Any help would be appreciated.

4 comments
Comment actions Permalink

StanAccy wrote:

...


What Regex do I need to match "#[0-9]+" (since the leading # is an important clarifier here) but drop the leading # character before it gets passed in to the URL?


There is no inbuilt help for this - clicking on the help button raises the following error:
"Help topic "project.propVCSSupport.Issue.Navigation" not found.


Any help would be appreciated.


Try this (untested; quotes not part of the RE itself; extra backslashes needed if encoded as a Java string literal not included): "(?<=#)[0-9]+\b"

I tested it (in IDEA)—It actually works.

There are some plug-ins that are meant to help you devise and test REs. You might want to try them out when you face a challenging RE requirement.


Randall Schulz

Message was edited by: Randall Schulz

0
Comment actions Permalink

Nick specifically asked for an RE that would exclude the # from the matched text.

Randall Schulz

0
Comment actions Permalink

Many thanks for the assistance. It was the $0/$1/$2 bit that I was missing.

0

Please sign in to leave a comment.