missing lookbehind

21 views
Skip to first unread message

Senjuu

unread,
Dec 31, 2018, 1:03:37 AM12/31/18
to TortoiseSVN
I wanted to use the integration to my issue tracker that tortoise offers.
But as I entered the Regular expression for the bugnumber I found out
that the lookbehind operators ("(?<=)", "(?<!)") were not supported.

So I would think it would be worth to implement this.
The reason I need this is that an example commit message could look like

/*Begin of Message*/
+CHANGED: The password could only hold forty(40) characters (#%BUGID%)

See also revision r42
/*End of Message*/

So my "Message part expression" was "\+(CHANGED|NEW):.+\(#\d+\)"
and my "Bug-ID expression" was "(?<=\(#)\d+(?=\))"
so that only the part I set %BUGID% in the example message would be matched by the "Bug-ID expression". But the dialog said "The regular expression is invalid!".

Stefan

unread,
Dec 31, 2018, 1:17:27 AM12/31/18
to TortoiseSVN
C++11 uses ECMAScript's regular expression syntax, lookbehind is not supported.

why not just use
\(#(\d+)\)
to extract the bug id?

Senjuu

unread,
Jan 1, 2019, 8:12:56 AM1/1/19
to TortoiseSVN
Because the Link would than be like
https://domain/showBug?id=(#42)
instead of

Stefan

unread,
Jan 3, 2019, 4:25:37 PM1/3/19
to TortoiseSVN
No, it wouldn't.
The group is used to extract the id. So it wouldn't catch the '#'.

Stefan
 

Senjuu

unread,
Jan 3, 2019, 4:34:01 PM1/3/19
to TortoiseSVN
It would.

From "+CHANGED: The password could only hold forty(40) characters (#10)"
the regex "\(#\d+\)
would match "(#10)"

Stefan

unread,
Jan 4, 2019, 1:49:30 AM1/4/19
to TortoiseSVN
Ok, I see your problem.
But why are you capturing the whole string? You could just try this:
\(#(\d+)\)    to catch the message part expression
(\d+)   to then catch the number


 
Reply all
Reply to author
Forward
0 new messages