Page 1 of 2

Find Files, Contents, Grep feature

Posted: 13 Oct 2011 03:33
by Ash
I would just like to put in a vote for regular expression support in the "Find Files", Contents text box, effectively making this a Grep tool.

I often use XYPlorer to seach the contents of source code files and about 50 percent of the time the wildcard content matching is fine. Having regexp would resolve the remaining 50 percent.

For example with regexp I could search for all commented lines that contain the word todo, but that do not contain the word ignore.

I did some searching here on the forums and found there were one or two similar requests from a couple of years ago. However at the time, admin said that it was possible but not in the current roadmap.

There were also some technical issues in the handling of large files. For me, limiting regexp searches to single lines (ie XYPlorer applies regexp to one line at a time) would be good enough, maybe not for everyone though.

Thanks for a fantastic application, XYPlorer is a hugely productive tool for me.

Ash

Re: Find Files, Contents, Grep feature

Posted: 14 Oct 2011 22:50
by Jerry
Ash wrote:I would just like to put in a vote for regular expression support in the "Find Files", Contents text box, effectively making this a Grep tool.
I heartily second that proposal.

Re: Find Files, Contents, Grep feature

Posted: 19 Oct 2011 10:24
by admin
I can only offer an approach where the pattern must match at least one chunk of 1024 characters in the file.

Re: Find Files, Contents, Grep feature

Posted: 19 Oct 2011 17:02
by Jerry
admin wrote:I can only offer an approach where the pattern must match at least one chunk of 1024 characters in the file.
I would be very happy enough with that.

Re: Find Files, Contents, Grep feature

Posted: 19 Oct 2011 20:57
by Trasd
I would like to put in a request for this feature as well - reading the "XYplorer Quick Facts," I thought this was an existing feature, one of the reasons I choose to trial XYplorer.

Re: Find Files, Contents, Grep feature

Posted: 20 Oct 2011 11:22
by admin
Trasd wrote:I would like to put in a request for this feature as well - reading the "XYplorer Quick Facts," I thought this was an existing feature, one of the reasons I choose to trial XYplorer.
Welcome to the club!

Actually I just finished adding that feature! 8)

Also cheers to Ash for kicking me.

Don

Re: Find Files, Contents, Grep feature

Posted: 21 Oct 2011 04:56
by Ash
Don,

Pleased to be able to give you a friendly kick :wink:

Not sure if you sacrifice small animals at the altar of "Agile", but the agile approach would be to implement the feature as is (with the 1024 limit) just to see how popular the Regex contents search actually is.

Then, if enough people actually notice it and ask "why the 1024 limit?" you may consider more fully tackling the technical issues in the future?

Thanks for this great tool.

Ash

Re: Find Files, Contents, Grep feature

Posted: 21 Oct 2011 10:01
by admin
Ash, have you tried the new beta and actually found yourself 1024-limited?

Re: Find Files, Contents, Grep feature

Posted: 21 Oct 2011 17:28
by Trasd
admin wrote:
Trasd wrote:I would like to put in a request for this feature as well - reading the "XYplorer Quick Facts," I thought this was an existing feature, one of the reasons I choose to trial XYplorer.
Welcome to the club!

Actually I just finished adding that feature! 8)

Also cheers to Ash for kicking me.

Don
Don, thank you. But I have not bought the program yet, I am still reviewing it (here). I will be quite frank in my comments! Are you sure you want to welcome me already (till you see what I have to say)? LOL :wink:

Actually, this program is looking great so far - nice job.


As far as the 1K limit - I don't see a problem with this. I currently use FileLocator Pro and am not looking for a replacement, but simply a quicker option when I'm in the middle of something - so I don't always have to pull out the "big guns!"

Also, BTW, can I even run the beta seeing as I don't yet have a license?

Re: Find Files, Contents, Grep feature

Posted: 21 Oct 2011 17:46
by Jerry
Ash, have you tried the new beta and actually found yourself 1024-limited?
I have been using regex routinely by default for over 21 years and I can count with less than the fingers of one hand the number of times I had to match something as large as 1024. And that was always within a perl or other script doing heavy-duty text parsing.

Re: Find Files, Contents, Grep feature

Posted: 21 Oct 2011 17:56
by admin
Jerry wrote:
Ash, have you tried the new beta and actually found yourself 1024-limited?
I have been using regex routinely by default for over 21 years and I can count with less than the fingers of one hand the number of times I had to match something as large as 1024. And that was always within a perl or other script doing heavy-duty text parsing.
Also note that I can easily enlarge this value at any point to much larger values if it is really necessary. The costs are only (minor) performance costs.

Re: Find Files, Contents, Grep feature

Posted: 21 Oct 2011 17:58
by j_c_hallgren
Trasd wrote: But I have not bought the program yet, I am still reviewing it (here). I will be quite frank in my comments! Are you sure you want to welcome me already (till you see what I have to say)? LOL :wink:
We try and welcome any new members here...I did so, right? If not, a belated welcome now...and the welcome is given unless they have as their very first post a list of a dozen+ items that they want changed (immediately of course :evil: ) and which usually are already in XY but they didn't research first.
Also, BTW, can I even run the beta seeing as I don't yet have a license?
I'm not aware of any reason you can't...the link is in the Beta thread...it wasn't there for a while but it's back.

Another outstanding feature of XY is the quick support thet you get here from the regulars and Don as Admin...sometimes answers come so quick, you're not ready for them!

Re: Find Files, Contents, Grep feature

Posted: 21 Oct 2011 18:05
by admin
Trasd wrote:Also, BTW, can I even run the beta seeing as I don't yet have a license?
Yes you can. And I hope you will.

That "review project" (I'd like to call it) is fine with me. Don't hesitate to throw it into my face. All is fine as long as you end up with an enthusiastic finish! :wink:

Re: Find Files, Contents, Grep feature

Posted: 26 Oct 2011 04:32
by Ash
Don,

I've just downloaded 10.5 and tried the some basic regexp contents searches and it is looking very good. Thanks for such a very quick response.

I think I may have misunderstood the 1024 character limit. I thought it was regarding size of the file to be searched. However one of the other comments here seems to be saying it is to do with the length of the search pattern. Is that correct?

Perhaps if you could give an example of where the 1024 limit could actually impact a search?

I'll play around with it a bit more to see if I can give any more useful feedback. I use Editpad Pro (another great one man product!) to do regexp searches within a single file, so it should be a good benchmark.

Regards,

Ash

Re: Find Files, Contents, Grep feature

Posted: 26 Oct 2011 09:02
by admin
I'll give you an example with a simple wildcard pattern (I'm no good at RegExp): If your pattern is a*b then it would match "ab", "axb", "axxb", "axxxb" etc. because wildcard * means "any number of characters". In XY's content search, however, this "any number" is restricted. The whole matching string "axxx.....b" will surely be found only if it is no longer than 1024 chars. It *might* be found if it is no longer than 32,768 chars. I will not be found if it longer than 32,768 chars.