Search after 2 character and delete alle between
-
Hi
Can Notepad ++ does this:
Search for 2 character and delete these two character and all between ?Example
Search after “(” and “)”
Results:
(summer)
(sun)
(flower)and delete all instances of:
(summer)
(sun)
(flower) -
Hello Steen-Frank-Mikkelsen,
one way would be to use regular expressions with replace dialog.
When dialog has been opened check Regular Expression in
Search Mode section.
Then put the following in Find what: (()(.*)())
and in Replace with: \1\3Cheers
Claudia -
Hello, Steen Frank Mikkelsen and Claudia,
I think that the correct regex S/R should be :
-
\(.*?\)in the Find what : zone -
Nothingin the Replace with : zone
with the Regular expression search mode checked, of course !
Notes :
-
The two round brackets, that have to be matched, must be escaped with a backslash character, in order to be taken literally, as there are special regex characters, which define a group
-
The syntax
.*?represents the shortest string of characters, between the two round brackets -
The other syntax
.*would have matched the largest string, between two round brackets. So, it could contain round brackets, itself !
Best Regards,
guy038
-
-
oopps, I thought ( ) should remain, but if I reread it clearly states
Search for 2 character and delete these two character and all between ?Cheers
Claudia
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