Searching

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
AnthonyCian
Senior Member
Senior Member
Posts: 265
Joined: 2005-06-16, 01:45 UTC
Location: Thatcher Az. USA

Searching

Post by *AnthonyCian »

Using XP and the current version of TC:

I will have filenames in this format:
x1-020216-1065-010.raw
x1-020216-1065-011.raw
x1-020216-1065-012.raw
I like to do a search on the number 1065, the characters before 1065 is ok, but I don't want the search to include the characrters after 1065.

That's because it will find the following, which I don't want.
x2-003456-0897-1065.raw

What would be the search string to use? That is, the cut off is the characters after 1065 in my first set of files shown. Thanks.
TC
User avatar
Flint
Power Member
Power Member
Posts: 3487
Joined: 2003-10-27, 09:25 UTC
Location: Antalya, Turkey
Contact:

Post by *Flint »

AnthonyCian
Sorry, I'm not sure if I understood you correctly. You want to find x1-020216-1065-010.raw but you don't want to find x2-003456-0897-1065.raw, right? If yes, then you can use regular expression search:
Search for: 1065[^\.]
RegEx: checked
(Note that there are two RegEx checkboxes, you need to check the first one, that is near the Search for editbox).
This expression means that you want to find number 1065 followed by any character except for dot.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 10.52 / Win10 x64
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Post by *Sheepdog »

Another search could be:

Code: Select all

1065-.
with regex on where you are looking for 1065- followed by any other char.

sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
User avatar
petermad
Power Member
Power Member
Posts: 14815
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

how about searching for:

Code: Select all

-1065-
without RegEx
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Post by *Sheepdog »

petermad wrote:without RegEx
I can't think that simple. ;) :lol:

sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
User avatar
AnthonyCian
Senior Member
Senior Member
Posts: 265
Joined: 2005-06-16, 01:45 UTC
Location: Thatcher Az. USA

Post by *AnthonyCian »

Hi everyone:

Flint:
Thanks for replying, but I only have 1 RegEx checkbox, which is just under the "Search In". I do not see a second one next to the "Search For" as you described. Should I have two, if so, I'm not seeing it? Anyway, I couldn't get your string to work.

PeterMad and SheepDog:
I knew it had to me something very very very simple. Both of your suggestions work, and a BIG THANK YOU for the search strings.

Anthony
User avatar
frenky
Senior Member
Senior Member
Posts: 250
Joined: 2005-07-30, 19:36 UTC

Post by *frenky »

You might also consider this very simple regex:

Code: Select all

-.*?-1065-
That would mean that you will only find
??-??????-1065-??????.???
<1>-<2>-<3>-<4>.<5>

Where 1,2,4 and 5 and can contain also string "1065" without affecting your search.

Btw. Flint's regex is OK... It states that it will search for all occurencies of 1065 except those that are followed by "." (dot).
Ambiguity succeeds where honesty dares not venture.
User avatar
AnthonyCian
Senior Member
Senior Member
Posts: 265
Joined: 2005-06-16, 01:45 UTC
Location: Thatcher Az. USA

Post by *AnthonyCian »

Hi Flint:
I got your code to work, I had a space. Also I think the regex you are refering to is the one I'm using, and the other (second) is in the search within text. All working fine and thanks.

Hi Frenky:
Thanks for the code, I will give it a try. I been really trying my best to understand the regex concept, but having a hard time.

Anthony
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

If you want help understanding REGEX one of the best guides I have seen is included with Xnews. The PCRE.html file in the zip. Theres very little difference - if any between the regex utilized in TC and the PCRE described there.
Hope that helps.
User avatar
frenky
Senior Member
Senior Member
Posts: 250
Joined: 2005-07-30, 19:36 UTC

Post by *frenky »

2Balderstrom
Very nice guide, far from beginer's guide. I've been using Xnews for some time now, but never seen this tutorial... Thanks for pointing it out!
Ambiguity succeeds where honesty dares not venture.
User avatar
SQUIRE
Senior Member
Senior Member
Posts: 373
Joined: 2005-06-16, 18:07 UTC

Post by *SQUIRE »

You can also brush up your regexp skills with The Regex Coach. Useful for watching how your inputs are parsed.
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

Just to note - Xnews has a "Test Regex" feature under the 'Special' menu as well. Its a fairly impressive piece of software for its minimalistic size.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
User avatar
AnthonyCian
Senior Member
Senior Member
Posts: 265
Joined: 2005-06-16, 01:45 UTC
Location: Thatcher Az. USA

Post by *AnthonyCian »

Thanks everyone for pointing out some info resources on Regex. Will check it out!

Anthony
Post Reply