Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Can Source Links handle a regex?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jschroedl
Tomato Guru

USA
107 Posts

Posted - Jun 26 2017 :  09:36:29 AM  Show Profile  Reply with Quote
First, I'm very happy to see Source Links coming to VA!

Our bug system uses an ID field of 'S' followed by a 7-digit number.

Example: // For details of this bug, see S0650240.

I tried to create a source link with Keyword of S and Value of number but it doesn't identify these bug numbers.

It seems like I'd need a regex to pick them out. Should this be possible? If not, could we enter an enhancement request?

The URL I'd need to form would be formed using the whole ID.

Example: http://bugs.example.com/case/S0650240

John

Edited by - jschroedl on Jun 26 2017 09:41:11 AM

sean
Whole Tomato Software

USA
2817 Posts

Posted - Jun 26 2017 :  3:29:59 PM  Show Profile  Reply with Quote
Under the covers, we do support regex expressions. It is not officially exposed in the UI at this time.

The following is subject to change but is applicable to builds 2219-2223.

You can use regex expressions if you start the keyword text with re=

For your use, the following are examples that will work:

keyword: re=(?<Keyword>S)(?<Value>\d+)
url: http://bugs.example.com/case/$(Keyword)$(Value)

keyword: re=(?<Value>S\d+)
url: http://bugs.example.com/case/$(Value)


Improved UI for regex support is case=109206.

Edited by - sean on Jun 26 2017 3:39:54 PM
Go to Top of Page

jschroedl
Tomato Guru

USA
107 Posts

Posted - Jun 26 2017 :  3:44:47 PM  Show Profile  Reply with Quote
Yes, indeed. That's perfect and is working!! That's awesome, I love it.

Thanks,
John
Go to Top of Page

StefanEgo
Ketchup Master

56 Posts

Posted - Jun 19 2018 :  11:44:40 AM  Show Profile  Reply with Quote
Running into a comparable situation myself. The disadvantages with the suggested regexps is that they also match inside words (f.e. AndroidS3 would be identified as a match with the regexp above). If I adjust the regexp to: re=(?<Keyword>\sS)(?<Value>\d+) (or alternatively simply: re=\sS(?<Value>\d+)) the above case would be handled correctly and S3 in AndroidS3 would not be marked. However this expression results in a different issue in that the leading space would then also be enclosed in the bracket for the source link which looks a bit ugly.

Is there any other suggestion to handle cases like these?
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Jun 19 2018 :  12:00:43 PM  Show Profile  Reply with Quote
Use \b instead of \s.
Go to Top of Page

StefanEgo
Ketchup Master

56 Posts

Posted - Jun 19 2018 :  12:08:39 PM  Show Profile  Reply with Quote
Thanks sean, that did the trick for me/us.
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Jun 20 2018 :  10:20:36 AM  Show Profile  Reply with Quote
Happy to help.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000