Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the format of regular expressions in gitk?

Tags:

git

regex

gitk

tcl

I'm trying to use the find/"adding/removing string"/regular expression option in gitk. The syntaxes I have tried don't work, and I can find no docs that describe the syntax of the regular expressions it accepts.

I'm trying to match both Modem_Wakup and Modem_UnWakeup. Neither Modem_(Un)?Wakeup nor Modem_\(Un\)?Wakeup, nor Modem_\(Un\)\?Wakeup, nor any other obvious ones work. I can find the strings individually, so I know there should be matches.

So what syntax does it use?

like image 967
Tim Schaeffer Avatar asked Feb 22 '11 22:02

Tim Schaeffer


People also ask

What does '$' mean in regex?

$ means "Match the end of the string" (the position after the last character in the string). Both are called anchors and ensure that the entire string is matched instead of just a substring.

What is\ s+ in regex?

The plus sign + is a greedy quantifier, which means one or more times. For example, expression X+ matches one or more X characters. Therefore, the regular expression \s matches a single whitespace character, while \s+ will match one or more whitespace characters.

What is\\ d in regex?

private final String REGEX = "\\d"; // a single digit. In this example \d is the regular expression; the extra backslash is required for the code to compile.

What is regex in VB net?

A regular expression is a pattern that could be matched against an input text. The . Net framework provides a regular expression engine that allows such matching. A pattern consists of one or more character literals, operators, or constructs.


1 Answers

This feature should be based on the pickaxe grep system, based on POSIX regexp.

But this thread reports some bug around this from gitk:

I presented the issue to #git, and it was suggested that it is probably a pickaxe bug in that it doesn't display changes in merge commits if they add strings that neither of their parents has.

This may not be your exact case though, simply an illustration that the feature isn't fully available yet.

like image 149
VonC Avatar answered Sep 23 '22 03:09

VonC