How to search for "Info [##].ext"?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Gandolf

How to search for "Info [##].ext"?

Post by Gandolf »

I need to search for files of the form "Info [##].ext" (## is one or more digits).

RegExp "Info \[.*\]\..*" works but I cannot get a standard expression to work - "Info \[*\].*" doesn't. It doesn't seem to escape the "[" or"]".

Any ideas??

I'm quite happy to use the RegExp's since I prefer them but curious if it can be done with a standard expression.

admin
Site Admin
Posts: 65185
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: How to search for "Info [##].ext"?

Post by admin »

Gandolf wrote:I need to search for files of the form "Info [##].ext" (## is one or more digits).

RegExp "Info \[.*\]\..*" works but I cannot get a standard expression to work - "Info \[*\].*" doesn't. It doesn't seem to escape the "[" or"]".

Any ideas??

I'm quite happy to use the RegExp's since I prefer them but curious if it can be done with a standard expression.
I think this way:
Info [[]##[]].ext

IOW: the [ and ] characters must be enclosed in [ and ]. Crazy... :)

Gandolf

Post by Gandolf »

Crazy indeed, but it works. I wonder why the "\" doesn't escape them since it escapes the "!". I think I'll stick to RegExp - I understand them.

admin
Site Admin
Posts: 65185
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Post by admin »

Gandolf wrote:Crazy indeed, but it works. I wonder why the "" doesn't escape them since it escapes the "!". I think I'll stick to RegExp - I understand them.
It's not my rules. The patterns are interpreted by some native function. Of course I could be so nice to convert \[ into [[]... good idea... :idea: :)

BTW: just found out that only the left one needs the crazy treatment. So this works too:
Info [[]##].ext

Gandolf

Post by Gandolf »

admin wrote:It's not my rules. The patterns are interpreted by some native function. Of course I could be so nice to convert \[ into [[]... good idea... :idea: :)
I think if that is the rule then stick to it, other users may know that is how it works. A mention of it in the find files section of the (dreaded) help file might be useful; since you mention "If you want to find items starting with "!" you have to escape it with """.

Gandolf

Post by Gandolf »

admin wrote:...Of course I could be so nice to convert \[ into [[]... good idea... :idea: :)...
Thanks for adding that, it gives me plenty of options now.

Post Reply