<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Val Giner</title>
    <description>The latest articles on DEV Community by Val Giner (@valginer0).</description>
    <link>https://dev.to/valginer0</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3254309%2Ff879afc8-8e32-4667-a891-99873cf97f97.png</url>
      <title>DEV Community: Val Giner</title>
      <link>https://dev.to/valginer0</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/valginer0"/>
    <language>en</language>
    <item>
      <title>Building a Modern Grep Alternative for Windows with .NET 9.0</title>
      <dc:creator>Val Giner</dc:creator>
      <pubDate>Mon, 09 Jun 2025 21:13:03 +0000</pubDate>
      <link>https://dev.to/valginer0/building-a-modern-grep-alternative-for-windows-with-net-90-3k49</link>
      <guid>https://dev.to/valginer0/building-a-modern-grep-alternative-for-windows-with-net-90-3k49</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;🪟 Bringing Unix power to Windows—no terminal required.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you’ve ever used the &lt;code&gt;grep&lt;/code&gt; command in Unix or Linux, you know how powerful it is for searching through text files. But for everyday Windows users—or even devs who prefer a GUI—there hasn’t been a satisfying, native alternative. That’s what inspired me to create &lt;strong&gt;WinFindGrep&lt;/strong&gt;, an open-source, grep-style search and replace tool built with &lt;strong&gt;.NET 9.0&lt;/strong&gt; and &lt;strong&gt;Windows Forms&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔍 What is WinFindGrep?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;WinFindGrep&lt;/strong&gt; is a lightweight desktop utility that lets you search for text across multiple directories and file types. It offers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Recursive search&lt;/strong&gt; through multiple folders
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;File filters&lt;/strong&gt; (e.g., &lt;code&gt;*.txt&lt;/code&gt;, &lt;code&gt;*.cs&lt;/code&gt;, &lt;code&gt;*.xml&lt;/code&gt;)
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Regex support&lt;/strong&gt;, case sensitivity, whole-word matching
&lt;/li&gt;
&lt;li&gt;Optional &lt;strong&gt;find-and-replace&lt;/strong&gt; across multiple files
&lt;/li&gt;
&lt;li&gt;Results with file path, line number, and preview
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Double-click&lt;/strong&gt; a result to open the file at the match
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No installation&lt;/strong&gt;—just run the standalone &lt;code&gt;.exe&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Demo &amp;amp; Downloads:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
🔗 &lt;a href="https://valginer0.github.io/WinFindGrepWebsite/" rel="noopener noreferrer"&gt;https://valginer0.github.io/WinFindGrepWebsite/&lt;/a&gt;&lt;br&gt;&lt;br&gt;
💾 &lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/valginer0/WinFindGrep" rel="noopener noreferrer"&gt;https://github.com/valginer0/WinFindGrep&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚙️ How It’s Built
&lt;/h2&gt;

&lt;p&gt;This project uses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;.NET 9.0&lt;/strong&gt; — the latest runtime for modern Windows desktop apps
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Windows Forms&lt;/strong&gt; — for rapid UI development and a familiar UX
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;C#&lt;/strong&gt; — with regex support, stream readers, and text manipulation
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The solution is structured cleanly:&lt;/p&gt;

&lt;p&gt;📂 Forms/ # UI components&lt;br&gt;
📂 Services/ # Search, replace, and file-system logic&lt;br&gt;
📂 Models/ # Data structures&lt;/p&gt;

&lt;h3&gt;
  
  
  File Collection Logic
&lt;/h3&gt;

&lt;p&gt;For file collection, I call &lt;strong&gt;&lt;code&gt;Directory.GetFiles()&lt;/code&gt;&lt;/strong&gt; with recursive logic to handle user-selected folders and file-type filters. This approach lets me:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Follow subdirectories&lt;/strong&gt; via &lt;code&gt;SearchOption.AllDirectories&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Filter by extension&lt;/strong&gt; (e.g., &lt;code&gt;*.cs&lt;/code&gt;, &lt;code&gt;*.xml&lt;/code&gt;, &lt;code&gt;*.txt&lt;/code&gt;)
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Process each folder independently&lt;/strong&gt; according to user input
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;While &lt;code&gt;Directory.GetFiles()&lt;/code&gt; works well for most scenarios, it loads all matches into memory at once, which can limit scalability on very large datasets. Future optimizations may include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Switching to &lt;strong&gt;&lt;code&gt;Directory.EnumerateFiles()&lt;/code&gt;&lt;/strong&gt; for a streaming approach
&lt;/li&gt;
&lt;li&gt;Using &lt;strong&gt;&lt;code&gt;EnumerationOptions&lt;/code&gt;&lt;/strong&gt; to explicitly include/exclude hidden or system files
&lt;/li&gt;
&lt;li&gt;Manually checking &lt;code&gt;File.GetAttributes()&lt;/code&gt; for fine-grained control
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📦 Self-Contained Deployment
&lt;/h2&gt;

&lt;p&gt;Thanks to modern .NET tooling, WinFindGrep ships as a &lt;strong&gt;single-file, self-contained executable&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;dotnet publish -r win-x64 --self-contained true -p:PublishSingleFile=true -p:PublishTrimmed=true&lt;/p&gt;

&lt;p&gt;Outcome:&lt;/p&gt;

&lt;p&gt;✅ No .NET runtime required on the user’s PC&lt;/p&gt;

&lt;p&gt;✅ No installer—just download and run&lt;/p&gt;

&lt;p&gt;✅ Easy to distribute via GitHub Releases, email, or USB&lt;/p&gt;

&lt;p&gt;🧠 &lt;strong&gt;Lessons Learned&lt;/strong&gt;&lt;br&gt;
GUI isn’t dead—many Windows users still prefer click-to-use tools.&lt;/p&gt;

&lt;p&gt;GetFiles() vs. EnumerateFiles(): streaming APIs scale better for huge data sets.&lt;/p&gt;

&lt;p&gt;EnumerationOptions is handy when you need explicit control over hidden/system files.&lt;/p&gt;

&lt;p&gt;A clear project structure (Forms/, Services/, Models/) pays off in long-term maintainability.&lt;/p&gt;

&lt;p&gt;🙌 &lt;strong&gt;Try It and Share Feedback&lt;/strong&gt;&lt;br&gt;
If you’re on Windows and need a powerful, grep-inspired tool that runs without installation, give WinFindGrep a spin:&lt;/p&gt;

&lt;p&gt;🌐 &lt;a href="https://valginer0.github.io/WinFindGrepWebsite/" rel="noopener noreferrer"&gt;https://valginer0.github.io/WinFindGrepWebsite/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;💻 &lt;a href="https://github.com/valginer0/WinFindGrep" rel="noopener noreferrer"&gt;https://github.com/valginer0/WinFindGrep&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Bug reports, feature ideas, and pull requests are very welcome. Thanks for reading—follow me for more .NET desktop tips and dev-tool deep dives! 🚀&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>csharp</category>
      <category>windowsutility</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
