Giter Club home page Giter Club logo

regexfilesearcher's Introduction

RegexFileSearcher

Cross-platform regex file searching tool in .NET 5.

Protip: use the RegexTestBench to test your regexes before using them in this tool.

Running

Windows

  • Start the app with RegexFileSearcher.Wpf.exe

Linux

  • Start the app from the terminal with ./RegexFileSearcher.Gtk

Mac

  • Complete compiling steps below, which will create the file RegexFileSearcher/RegexFileSearcher.Mac/bin/Release/net5.0/osx-x64/osx-x64/RegexFileSearcher.Mac.app
  • Start the app from the terminal with open RegexFileSearcher/RegexFileSearcher.Mac/bin/Release/net5.0/osx-x64/osx-x64/RegexFileSearcher.Mac.app
  • Start the app from Finder by double-clicking RegexFileSearch.Mac (the .app file extension will be hidden by default)

Compiling

Windows

  • Download and open the repo in Visual Studio 2019
  • Publish RegexFileSearcher.Wpf

Linux

  • Install the .NET 5 SDK
  • You need to have GTK3 installed too
  • Git clone
  • Publish with dotnet publish RegexFileSearcher/RegexFileSearcher.Gtk/RegexFileSearcher.Gtk.csproj --configuration Release --output publish --self-contained true -p:PublishSingleFile=true --runtime linux-x64 --framework net5.0

Mac

  • Install Visual Studio 2019 for Mac
  • Git clone
  • Publish with dotnet publish RegexFileSearcher/RegexFileSearcher.Mac/RegexFileSearcher.Mac.csproj --configuration Release --output publish --self-contained true -p:PublishSingleFile=true --runtime osx-x64 --framework net5.0

Debugging

Windows

  • With Visual Studio 2019 Community
    • Set RegexFileSearcher.Wpf as startup project
  • Or with Visual Studio Code

Linux

  • With Visual Studio Code

launch.json:

 {
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
        "name": "Debug on Linux",
        "type": "coreclr",
        "request": "launch",
        "preLaunchTask": "build",
        "program": "dotnet",
        "args": ["${workspaceFolder}/RegexFileSearcher/RegexFileSearcher.Gtk/bin/Debug/net5.0/RegexFileSearcher.Gtk.dll"],
        "cwd": "${workspaceFolder}",
        "stopAtEntry": false,
        "console": "internalConsole"
    }]
}

tasks.json

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build",
            "command": "dotnet",
            "type": "process",
            "args": [
                "build",
                "${workspaceFolder}/RegexFileSearcher/RegexFileSearcher.Gtk/RegexFileSearcher.Gtk.csproj",
                "/property:GenerateFullPaths=true",
                "/consoleloggerparameters:NoSummary"
            ],
            "problemMatcher": "$msCompile"
        },
        {
            "label": "publish",
            "command": "dotnet",
            "type": "process",
            "args": [
                "publish",
                "${workspaceFolder}/RegexFileSearcher/RegexFileSearcher.Gtk/RegexFileSearcher.Gtk.csproj",
                "/property:GenerateFullPaths=true",
                "/consoleloggerparameters:NoSummary"
            ],
            "problemMatcher": "$msCompile"
        },
        {
            "label": "watch",
            "command": "dotnet",
            "type": "process",
            "args": [
                "watch",
                "run",
                "${workspaceFolder}/RegexFileSearcher/RegexFileSearcher.Gtk/RegexFileSearcher.Gtk.csproj",
                "/property:GenerateFullPaths=true",
                "/consoleloggerparameters:NoSummary"
            ],
            "problemMatcher": "$msCompile"
        }
    ]
}

Mac

  • With Visual Studio 2019 for Mac, I guess

regexfilesearcher's People

Contributors

commonloon102 avatar n0-fun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

regexfilesearcher's Issues

Search in compressed files

Add option to search in compressed files.
In this case, the search would take place in compressed files (e.g.: zip, gz, bz2, etc.; whatever we would support) too.
Inside the compressed file, only those files would be searched where the filename would match the pattern provided by the user (if any).

Invalid regex

Warn the user that the regex is invalid instead of crashing the app.

Regex timeout controls improvements

This issue tracks changes that fix visibility issues of regex timeout settings.
In particular, the following issues will be addressed:

  • Misalignment of NumericStepper and labels.
  • Timeout value getting cut-off on high DPI setting because it is measured in thousands of milliseconds.

Add an option for maximum file size limit

Regex operates on text, not binaries. As such, the current implementation simply reads the entire file into one string object.
While this approach avoids issues arising from buffered reading (such as a potential regex match getting cut-off), it poses a problem when a large file is encountered during file search.
This could be solved by allowing the user to specify a maximum file size, beyond which a file would be ignored.
A sane default, such as 5 MB would be preferred. See discussion.

README.md: Debug build on Mac instead of release

The building process should create a binary what is built in release mode.
The README.md should be updated to publish the app on Mac instead of building it in debug mode.
Is it possible to build it on Mac in a similar way what we have now for Linux?

Something like this should work:

dotnet publish RegexFileSearcher/RegexFileSearcher.Mac/RegexFileSearcher.Mac.csproj --configuration Release --output publish --self-contained false --runtime osx-x64 --framework netcoreapp3.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.