stefankueng / grepwin Goto Github PK
View Code? Open in Web Editor NEWA powerful and fast search tool using regular expressions
Home Page: https://tools.stefankueng.com/grepWin.html
License: GNU General Public License v3.0
A powerful and fast search tool using regular expressions
Home Page: https://tools.stefankueng.com/grepWin.html
License: GNU General Public License v3.0
Hello
Some characters are going outside of GrepWin and doing action in other, stealing focus, and doing actions which aren't usual for most utilities.
Right now when I type and press "o" the selected file below will be opened, yesterday when I was typing and had to press "o" it switched focus to Visual Studio 2017 Community and started typing there.
I did not had VS2017 open right now, I do have git bash open, opera, firefox, most of the programs are quite recent because this is a fresh (2 month) old Windows 10 installation.
The following command prepopulates the fields in the GUI when it opens, but isn't performing the actual search:
grepWin /searchpath:"Code/pom.xml" /searchfor:"<version>(\d\.\d\.\d-SNAPSHOT)</version>" /replacewith:"<version>1.0</version>" \execute \executereplace \closedialog
Is this a known bug in 1.8.1 or am I doing it wrong? I have been using this page as a reference: https://tools.stefankueng.com/grepWin_cmd.html
I frequently find it useful to be able to rename groups of files with regular expressions, but I am not an expert with regexp syntax and often must experiment a bit to figure out what syntax will accomplish what I want. Having done that once, it would be highly desirable to save that expression as a template with a descriptive name that I could reuse later and avoid re-inventing the wheel. I have used awxRenamer in the past because it had that feature, but I found its Perl(?) expression syntax even more inscrutable.
The updated Italian translation file.
Consider to switch beween them, as the location of the Search button can be better IMHO.
Big fan of the tool and recently decided to checkout the source. I was unable to find any documentation on best practices for contributing to the project, and the license is not immediately apparent in GitHub (I found this after searching but looks like its for the installer).
Perhaps adding LICENSE/CONTRIBUTING/README files would help bring others like myself up to speed on how the project is managed and encourage others to contribute. (Case in point, my lack of standardized naming/formatting for this issue ๐). It looks like grepWin was just recently moved to GitHub so apologies if this is already in the works.
After creating a search thread, grepWin never closes the associated handle. So with every search a zombie thread remains. Currently the code looks like this:
DWORD dwThreadId = 0;
m_hSearchThread = CreateThread(
NULL, // no security attribute
0, // default stack size
SearchThreadEntry,
(LPVOID)this, // thread parameter
0, // not suspended
&dwThreadId); // returns thread ID
I tried to create a pull request, but failed to get beyond the first page that gets displayed when clicking 'New pull request' :-(
So I am suggesting the change here:
DWORD dwThreadId = 0;
HANDLE hThread = CreateThread(
NULL, // no security attribute
0, // default stack size
SearchThreadEntry,
(LPVOID)this, // thread parameter
0, // not suspended
&dwThreadId); // returns thread ID
if (hThread != nullptr)
{
CloseHandle(hThread);
}
else
{
SendMessage(*this, SEARCH_END, 0, 0);
}
Furthermore 'm_hSearchThread' should be removed from CSearchDlg's members.
Ciao,
Rocco
When double clicking on one of the files in the search result to open it up in the editor and Notepad2-mod is installed i am getting an error that file "/g 123" can not be opened. That's because the line parameter /g must be set before the file name.
Simply replacing linenumberparam with linenumberparam_before fixes this for me.
Line 1903 in bbb9ff7
how do I match phrase1
and phrase2
with any characters in between?
I can't find any examples in your help files.
Last line of README.md is:
Please visit the homepage of BowPad for more information.
This should be changed to correct project's homepage.
When searching for the word ุฃูู ูุงู ู for example in Text search it bring results, however using Regex search to find \bุฃูู ูุงู ู\b only without any letters before or after it, it brings results for word that include that word like ูุฃูู ูุงู ูู or ูุฃูู ูุงู ููู . However it should bring only ุฃูู ูุงู ู word
Hi Stefan,
In your latets grepWin 1.8.1.778 file name matches don't work as they should (or at least how I think they should).
When I enter "sources.*" in the file names match box, I expect grepWin to find "sources." and "sources.inc" and "sources.cmn", etc, but it doesn't. It finds all sources files with an extension, but not "sources."
Even if I enter "sources." in the file match box, it won't find "sources.". I have to enter "sources" (so without the ending dot) for grepWin to actually find the search string inside my "sources." file.
File match option set to "Text Match" (no regex match selected).
I hope it is clear what I mean.
Can you preview
the changes to be made to one or more files? This would help confirm if the replace search will turn out as expected. Difficult to visualize changes with regex terminology. a preview window that can be refreshed is a good idea.
The license previously was understood to be GPL2+ based on header comments in each source file. However, a recent commit added the LICENSE file which is AGPL3+. The AGPL doesn't seem to be super relevant for a desktop application (as opposed to remote network service providing code). Did the incorrect license get added into LICENSE inadvertently, or is it meant to imply a license change?
Hi @stefankueng and thanks for your awesome app!
Do you by any chance plan on updating the program's main icon?
Currently this icon resembles the Windows XP set, and since you're no longer supporting either XP or Vista, I'd like to ask if you could update the icon to match Windows 7 and newer.
Maybe go for a flat looking one?
I have a large file. I see that results have been found, but cannot see what they actually are. Is this supported?
I,
I really love this tool that I use almost daily. However I found recently that there was no option to restrict the Search/Replace to "Match whole word" case. I think it would be an even better tool with this feature.
Best regards,
https://chocolatey.org/packages/grepwin
The project lead over at Chocolatey, @ferventcoder , had setup a mechanism to download & install grepWin from SourceForge. With the move to Github, and considering the date on the current package; I'm curious if you'd be willing to help him with maintaining the package.
For use where I'm at, I made an internal package; but I was able to extrapolate what you guys would need for the regular install scripts (unless you're fine with a binary version being installed, sans Github). You'd still want to do a choco new grepwin & edit the template there accordingly.
chocolateyinstall.ps1
$ErrorActionPreference = 'Stop'; # stop on all errors
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$packageArgs = @{
packageName = $env:ChocolateyPackageName
unzipLocation = $toolsDir
fileType = 'msi' #only one of these: exe, msi, msu
url = 'https://github.com/stefankueng/grepWin/releases/download/1.8.0/grepWin-1.8.0.msi'
url64 = 'https://github.com/stefankueng/grepWin/releases/download/1.8.0/grepWin-1.8.0-x64.msi'
softwareName = 'grepWin*' #part or all of the Display Name as you see it in Programs and Features. It should be enough to be unique
checksum = 'AD2EB6F672031138A6196222DD6B74D2A4896FB68676C8F484DC21AD150FF32C'
checksumType = 'sha256'
checksum64 = '89C6F8796CEBB5FABE6CCC81F39D861FC9EBFE95C784F893E96B5D2AF200A13E'
checksumType64 = 'sha256'
silentArgs = "/qn /norestart /l*v `"$($env:TEMP)\$($packageName).$($env:chocolateyPackageVersion).MsiInstall.log`"" # ALLUSERS=1 DISABLEDESKTOPSHORTCUT=1 ADDDESKTOPICON=0 ADDSTARTMENU=0
validExitCodes = @(0, 3010, 1641)
}
Install-ChocolateyPackage @packageArgs
chocolateyuninstall.ps1
$ErrorActionPreference = 'Stop'; # stop on all errors
$packageArgs = @{
packageName = $env:ChocolateyPackageName
softwareName = 'grepWin*' #part or all of the Display Name as you see it in Programs and Features. It should be enough to be unique
fileType = 'MSI' #only one of these: MSI or EXE (ignore MSU for now)
silentArgs = "/qn /norestart"
validExitCodes = @(0, 3010, 1605, 1614, 1641) # https://msdn.microsoft.com/en-us/library/aa376931(v=vs.85).aspx
}
$uninstalled = $false
[array]$key = Get-UninstallRegistryKey -SoftwareName $packageArgs['softwareName']
if ($key.Count -eq 1) {
$key | ForEach-Object {
$packageArgs['file'] = "$($_.UninstallString)"
if ($packageArgs['fileType'] -eq 'MSI') {
$packageArgs['silentArgs'] = "$($_.PSChildName) $($packageArgs['silentArgs'])"
$packageArgs['file'] = ''
}
Uninstall-ChocolateyPackage @packageArgs
}
}
elseif ($key.Count -eq 0) {
Write-Warning "$packageName has already been uninstalled by other means."
}
elseif ($key.Count -gt 1) {
Write-Warning "$($key.Count) matches found!"
Write-Warning "To prevent accidental data loss, no programs will be uninstalled."
Write-Warning "Please alert package maintainer the following keys were matched:"
$key | ForEach-Object {Write-Warning "- $($_.DisplayName)"}
}
Thanks! ๐
I am using this regular expression that does suppose to work, but doesn't work properly in grepWin.
\[(?![A-Z_]+\])([a-zA-Z_]+[\w]+)\]
When testing on the following, it shows "no match":
$result['toc']="<b><a href=$PHP_SELF#$result[faq_id]>$result[question]</a></b>";}
However, on regex101 it works fine (matching faq_id and question):
https://regex101.com/r/efzfQz/1/
Any way to fix this?
Thank you
For my use-cases it would be extremely helpful if I could use the "Limit Search" filters to exclude files by dateCreated/dateModified rather than just by size. I wouldn't have to be done with fancy datepicker dialogs either - a free-text input for a date string in the system locale, or a simple "older than/newer than" with a numeric input for the number of days would be sufficient.
Could a feature like that be added in a future version?
It might be my misunderstanding, but i tried over and over with several forms, and still can't exclude deeper subdirectories. pls confirm this is either a bug or a documentation failure
The intuitive form for the exclude dirs i used is: "node_modules|_build|_dist|www|web\shared|mobile\shared", which works for excluding the node_modules, _build, etc subdirectories, but not for the more complex paths web\shared or mobile\shared.
Tried it with backslashes, forwardslashes, double back- or forward-slashes, combined back-/forward-slash, with single or double quotes around the sub-path, but i keep getting results from the sub-paths
What is the problem?
grepWin is great for finding files by regexing their content, and I like the results display very much.
Sometimes, I do, however, wish for getting an enhanced results table, where I cannot only see the line that matched my search expression, but where I get one additional column for each capturing group in the regular expression.
I think this feature is not yet included (?)
(I looked at the sources, but unfortunately, my current development ecosystem is not quite set up for C++. Maybe I'll return to this later.)
If the results window height is less than that of a single row, clicking on a result causes it to disappear. What seems to be happening is that, for some reason, it's causing the results window to scroll, moving the selected result up, resulting in it being hidden. Not only should it not scroll just by clicking on an item, but if there's only one result, it shouldn't be able to scroll at all. The best way to witness what's happening is by doing a search that has multiple results, then shrinking the window and clicking on the one that's visible. You'll see that the next result after the one you clicked becomes visible, and the process repeats itself as it continues to scroll as you click. I probably wouldn't have noticed this except by default the program loads with the results window being very small, which seems like its own issue, as it would make much more sense to have it default to a reasonable size, perhaps at least 10 lines.
The "Exclude Dirs" filter is invaluable but I also find myself wanting to to the opposite:
Search only folders of a certain name within a directory tree.
I should be able to use Exclude dirs with a regex for this but I failed to do so.
Wanting to only see matches in paths that contain "foo" I used: ^((?!foo).)*$ or ^((?!.foo).)$
Both regex work in the "Test regex" feature for regular text matching but not for Exclude dirs.
Maybe I got the syntax wrong?
Failing that I would like a negate checkbox for Exclude Dirs which turns Exclude filter into an Include filter ;-)
Can we have an option to retain the old "last modified date" in a file? Multi file search/replace is good but I don't always want to change the "last modified date".
There are other programs that can make changes to text-based files and retain the last modified date that is shown in windows explorer. (I assume they save the old last modified date and after writing to the file overwrite the last modified date to the old date)
In Notepad++ I use the following regex (([^()](?:(?R)[^()])+)) to search for sentences with more than one parentheses. However in grepWin it brings "no match" through the Regex Text, although NP++ and grepWin use Boost.
Suggestion: Add support for searching for binary data
E.g. in the form of hex values
An option to search for whole files within other files would also be useful.
Hi, does it support matching multiple regex to find varying strings in a number of files recursively? Thanks!
Hi,
I was trying to use grepwin. First I tried my regular expression with the onboard tool "Test Regex". After it worked I used the software on a folder with files that should be found by RegEx. Unfortunately it didn't found any. After that I designed a text file using Editor and suprise the file was found by grepwin.
Afterwards I put the expressions from the text files in a WORD document (docx) Office 2010. This time grepwin didn't found the Word-document but the text file.
It seems that docx Files are not searchable? Is this true because then the whole GREP-Search is not usable. That would be a shame because I love GREP.
To stefankueng / grepWin:
A few days ago, I downloaded a setup program(grepWin). I tried to install 'grepWin' onto my laptop, and during the initial installation, I get the error: "The installation package is not supported by this processor type". According to my laptop, it is running Windows 7 Pro, and it says that I have SP1. Is there a way of really finding out you really have SP1?? This is closed 'issue' called: "No Results under Win7 SP1 #12" which has no relationship to. I would like to install it on my laptop, so what do I need to do.
GitHub/skiutah1 Thanks. / Nov 21, 2018
When you hover the mouse pointer over a result a tooltip appears showing matching lines. Unfortunately those tooltip closes way too quickly (a few seconds) to be useful, if there are either multiple matching lines or the lines are very long. Is there a way to keep the tooltips open indefinitely as long as the mouse pointer is hovering over the respective result?
Hello,
I send to you the Italian translation file I tested in the latest days. It seems working well.
I tried 1.8.0 and the preview you have looks like Windows 10...and that looks fine...still too big though.
I'm using it on Windows 7 and the GUI looks like it lived on mac & cheese for several months and now can't get out the door to go anywhere so it's smashing a hole through the wall with its face.
I'll use it on my Windows 10 laptop but I'll stick with 1.7.2 on my workstation because it's not hideous. :)
I'v updated the Chinese lang file for grepWin v1.81, please merge it to the dist.
Chinese.zip
hello Stefan, I using GrepWin for a long timp. I am a web designer, I use your tool as regex tool to repair many things on my 10.000 html pages. I am also a guru in regex.
I have one single problem. Many times, I need to implement multiple operations and I don't have time for manage all those operations, each one.
Can you make some kind of Batch Process, so to use many saves regex in order I want, so as to resolve my problems when I am gone for laptop?
I send you a print screen of another text procesor, named TextCrawler (not so faster as GrepWin), just to see how should works.
So, I write regex in order I want, press ok, and it runs every command till finnish. Wonderfull Idea !
hello, I use notepad++ with the regex below to remove all empty spaces from the html tag <p class="text_obisnuit">
. In notepad++ works PERFECT. But, with grepWin is not working. Doesn't replace the (?1$0)(?2\x20)
SEARCH:
(?s)(?:\G|<p class="text_obisnuit">)(?:(?!<|>).)*?\K(?:(^\h+)|\h+$|(?<=>)\h+|\h+(?=</p>)|(\h{2,})(?=[^<\h]))
REPLACE BY:
(?1$0)(?2\x20)
EXAMPLE: <p class="text_obisnuit"> Avoid opening an issue that may already exist by quickly scanning through related issues with similar titles and content.</p>
Hey,
Heeads up...
In read me:
[![grepWin](https://tools.stefankueng.com/img/grepwin/grepWin_search-small.9f66a88a.png)](https://tools.stefankueng.com/img/grepwin/grepWin_search.4e72bf88.png)
Both images don't appear to exist. Should fix.
Thanks,
Will
Just a feature idea. The ability to export the search results to a text or csv file would be nice feature and help for processing content-wise searching.
Really love your utility, especially for it's amazing regex search capability, one of the best implementations I have ever seen. Thank you.
I think it would be great and very useful if you add more features to it, which are available in NirSoft's SearchMyFiles (which doesn't have regex capabilities unfortunately), for example.
Features like:
Truly appreciate your work. Thank you again. :)
First of all, great program! I've been using AstroGrep, which is also a fantastic program, but I'm currently performing searches on massive amounts of data (~2,000 text files, 40GB total) and, while I've found grepWin to be 50% faster than AstroGrep, it could still be much, much faster if it supported multithreading/parallelization. I have an 8-core CPU, so plenty of threads available, yet the CPU is barely being utilized at all. The same goes for my SSD, which is at ~5% utilization during a search. Unsurprisingly, there's no difference with a RAM disk (actually, it ran a hair faster on the SSD, though that could just be margin of error). To search all the files for a string takes 8 minutes, but it should be able to do it in 1/10 the time or less if it took full advantage of the hardware.
I believe it should be make an option: "check for updates"
The program takes a significantly longer amount of time to perform a search when there are more results found, which seems to be an issue itself (in fact, I'm pretty sure searching one 200MB file with ~100,000 results took far longer than searching all ~2,000/40GB of files when there was only one results). But to make matters worse, during this time the program stops responding, which not only makes it look like it's frozen, but makes it impossible to cancel the search. Also, once complete, switching from 'Content' to 'Files' view for the results takes a while, and switching back to 'Content' takes even longer (much longer, in fact), and in both cases the program again stops responding during this time. Even starting a new search takes a while and causes it to stop responding, as it seems it struggles to clear the long results list as part of the execution of the new search. Assuming the new search has only a few results, performing it a second time goes much, much faster since it doesn't have to clear so many beforehand the second time.
As for the issue of it taking so much longer when there's more results, this doesn't seem to be a bug, as AstroGrep has the same problem, but it doesn't make much sense either. Regardless of whether there's 1 or 100,000 results, it still has to search all the lines in the file(s), so the only extra task is to keep track of the results. I find it very surprising that takes so much longer.
When the results view is set to 'Content,' the text field is empty for all findings from text files larger than 70MB (and possibly other file types, but I only tried with text files). This applies whether searching a single file or a group of files, in which case there will be entries in the text column for any files <70MB but nothing for files >70MB.
The "/" buttons in the "Search" area open dialog boxes, but the same buttons in the "Limit search" area only cause the blue border around the "Search" button to cycle on and off.
Russian.zip
I made a language file for the Russian language for the program grepWin.
I send it to you. But some GUI elements of the interface require adjustments. Is it possible to somehow fix it?
Hi Support,
I am a new user of GrepWin.
The first search I ran, for each file, the Search Results displayed the line containing the text string for which I was searching โ Perfect!!
However, all searches thereafter failed to display the line - donโt know why the change. Donโt see anything in the options that would control display of the text line.
Being able to view that text line is critical to my needs. How can I get GrepWin to again display the text lines?
Help me, Obi Wan. Youโre my only hope!
Every time grepWin is launched, the 'Files' results view is selected, even if 'Content' was selected before. Not sure if this is a bug or not, but it would be nice if this setting was remembered so it doesn't have to be changed every time.
Hello. Please correct this. Different distance between buttons and border.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.