regular expressions

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
mrbeeye
Junior Member
Junior Member
Posts: 85
Joined: 2004-05-03, 02:56 UTC

regular expressions

Post by *mrbeeye »

I am interested in highlighting files like WinRAR archives (r00, r34, ...).

It's quite sure it is needed to use RegExp.

Here is some samples I used but none of them really worked:
\w+\.r[0-9]+
\w+\.r\d+
\w+\.r\d\d

I tried \\w+\\.r[0-9][0-9] in Linux (egrep) and it worked. I tried that (with and without double \\) in TC and nothing happened.
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Re: regular expressions

Post by *Sheepdog »

mrbeeye wrote:I am interested in highlighting files like WinRAR archives (r00, r34, ...).

It's quite sure it is needed to use RegExp.

Here is some samples I used but none of them really worked:
\w+\.r[0-9]+
\w+\.r\d+
\w+\.r\d\d

I tried \\w+\\.r[0-9][0-9] in Linux (egrep) and it worked. I tried that (with and without double \\) in TC and nothing happened.
from Totalcmd.hlp

Code: Select all

New: You can now also use regular expressions. They need to be started with a "<" character, to distinguish them from normal search strings.
I tried all your suggestions and they work all perfectly well (the last oneof course without double'\')

sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
mrbeeye
Junior Member
Junior Member
Posts: 85
Joined: 2004-05-03, 02:56 UTC

regular expressions

Post by *mrbeeye »

Yeah. It worked except the one with [0-9].
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Re: regular expressions

Post by *Sheepdog »

mrbeeye wrote:Yeah. It worked except the one with [0-9].
As I said: Theey wored all fine for me. Including '[0-9]+' and '[0-9][0-9]'.
Maybe you missed the [+] while testing?

sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
mrbeeye
Junior Member
Junior Member
Posts: 85
Joined: 2004-05-03, 02:56 UTC

regular expressions

Post by *mrbeeye »

Yeah. Thanks.

It really works.

I don't know what I've done before.
Post Reply