stefankueng / grepWin

A powerful and fast search tool using regular expressions
https://tools.stefankueng.com/grepWin.html
GNU General Public License v3.0
1.72k stars 179 forks source link

I can't do search and replace for multiple lines of code #460

Closed me-suzy closed 6 months ago

me-suzy commented 6 months ago

I try to FIND and REPLACE this:

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-5LXZSBG');</script>
<!-- End Google Tag Manager -->

with this:

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-5QVRTGE6B7"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-5QVRTGE6B7');
</script>
<!-- End Google Tag Manager -->

This is a simple find and replace. Doesn't work at all. I also try with regex, I try all combinations. Doesn't work

image

or this:

image

lifenjoiner commented 6 months ago

Will be fixed after I finish the code refactoring at hand. There are conflicts. Thanks for your report!

me-suzy commented 6 months ago

this problem was from the beginning. Please write me back after you repair the code. Please test the code with other variables. Because I may have longer text, with any kinds of simbols, regex, etc. Regular TEXT SEARCH mus FIND and REPLACE all the lines exactly as they are

lifenjoiner commented 6 months ago

try bf47a2a

me-suzy commented 6 months ago

how to use that code?? I am frontend use. I must use directly the software, not the code...

I am using this version, portable:

grepWin-2.0.15_portable.zip

stefankueng commented 6 months ago

https://github.com/stefankueng/grepWin/actions/runs/8065122982 at the bottom, click the 'grepwin-64' link: https://github.com/stefankueng/grepWin/actions/runs/8065122982/artifacts/1278716808

me-suzy commented 6 months ago

works, thanks. You can now update the newest verstion with this one.

image

me-suzy commented 6 months ago

also be aware of one thing. In this version, if I check the option "Include Subfolders", than it is not possible to do FIND and REPLACE in several folders.

For example SEARCH in two folders, and I check the option "Include subfolders"

e:\Carte\BB\17 - Site Leadership\Principal\ro\|e:\Carte\BB\17 - Site Leadership\Principal\en\

It doesn't do anything.

I have to take a separate folder:

e:\Book\BB\17 - Site Leadership\Principal\ro\ e:\Book\BB\17 - Site Leadership\Principal\en\

If I don't check the option "Include subfolders", then it works to FIND and REPLACE in many folders

lifenjoiner commented 6 months ago

several folders

fixed by 7562c1f.

me-suzy commented 6 months ago

ok, these new updates, will be in the newest version?

lifenjoiner commented 6 months ago

There are other works in progress. There will be new version when it is stable enough. Stay steady.

me-suzy commented 6 months ago

please send me the .exe files, with the last fixed by 7562c1f.

I want to test again, see if replacement in subfolders works