Searching
Moderators: white, Hacker, petermad, Stefan2
- AnthonyCian
- Senior Member
- Posts: 265
- Joined: 2005-06-16, 01:45 UTC
- Location: Thatcher Az. USA
Searching
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
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
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.
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
Using TC 10.52 / Win10 x64
Another search could be:
with regex on where you are looking for 1065- followed by any other char.
sheepdog
Code: Select all
1065-.
sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
how about searching for:
without RegEx
Code: Select all
-1065-
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
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
- AnthonyCian
- Senior Member
- Posts: 265
- Joined: 2005-06-16, 01:45 UTC
- Location: Thatcher Az. USA
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
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
You might also consider this very simple regex:
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).
Code: Select all
-.*?-1065-
??-??????-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.
- AnthonyCian
- Senior Member
- Posts: 265
- Joined: 2005-06-16, 01:45 UTC
- Location: Thatcher Az. USA
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
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
- Balderstrom
- Power Member
- Posts: 2148
- Joined: 2005-10-11, 10:10 UTC
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.
Hope that helps.
You can also brush up your regexp skills with The Regex Coach. Useful for watching how your inputs are parsed.
- Balderstrom
- Power Member
- Posts: 2148
- Joined: 2005-10-11, 10:10 UTC
- AnthonyCian
- Senior Member
- Posts: 265
- Joined: 2005-06-16, 01:45 UTC
- Location: Thatcher Az. USA