I found that in 123
, \d
matches 1
and 3
but not 2
. I was wondering if \d
matches a digit satisfying what kind of requirement? I am talking about Python style regex.
Regular expression plugin in Gedit is using Python style regex. I created a text file with its content being
123
Only 1
and 3
are matched by the regex \d
; 2
is not.
Generally for a sequence of digit numbers without other characters in between, only the odd order digits are matches, and the even order digits are not. For example in 12345
, the matches are 1
, 3
and 5
.
\d
will match1
,2
and3
. If it doesn't there must be something else in your expression. Can you show your full expression? – Alex Aza\d
is shorthand for[0-9]
, so it ought to match2
. Please post a complete test case (a script that can be run, which demonstrates your problem) and maybe we can figure out what's wrong. – zwol11111
and22222
. – zwol