Problem with the search and replace function
-
Hi,
I just have installed Notepad++ and it works well for some search and replace work. I have a folder with hundreds of sub folders, with about 4000 html files. What I want to do is: delete all of the html in the files except for a small part (four lines - the files are 40kByte!).
If I search for e.g. “<head>” and replace it with “” (nothing), this works well. But I’d like to delete larger parts of the files, e.g. the whole head section, that is: all between “<head>” and “</head>”. I tried it with <head>(.*?)</head> and a lot of other expressions found here in the forum, but none of them works?? What am I doing wrong??Truly yours,
Wolf -
It seems like you might need to span lines with your search? Maybe try:
Find-what zone:
(?s)<head>.*?</head>The
(?s)part will allow the.part to match line-ending characters, thus allowing the matching to cross line boundaries. -
YES!!
Stupid me…
Works well now!
Thanks a lot!!
:-) Wolf
(By the way: Is there a help file somewhere? Beside foum and “Command LIne Arguments”?
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login