How can I delete rest of the line after a specific string?
By John Campbell •
I'm looking for a way to search for a specific string e.g. '=UUID:' and delete it and all following characters per line. I would prefer a way/macro/addon for notepad++. But all other tools or scripts are welcome :)
Before
*://81.88.22.6/*=UUID:63969B2469B7A94EBBDBD7CB5B9C00BA *://*-ad.cgi*=UUID:3C8EFF48B674CC42BF5B6E2B7BA820E7 *://*-ads/*=UUID:0D6CF7D5BE3F034C8A136CC99A074406Note that the numbers are always different per line so you couldn't do a search 'n replace with them.
Should look like this after
*://81.88.22.6/*
*://*-ad.cgi*
*://*-ads/* 3 Answers
Search mode regular expression, Find
=UUID:.*Replace with nothing.
3It's easy. Your question:
*://81.88.22.6/*=UUID:63969B2469B7A94EBBDBD7CB5B9C00BA
*://*-ad.cgi*=UUID:3C8EFF48B674CC42BF5B6E2B7BA820E7
*://*-ads/*=UUID:0D6CF7D5BE3F034C8A136CC99A074406My answer:
[=].*Result:
*://81.88.22.6/*
*://*-ad.cgi*
*://*-ads/*Explanation:
= character, represent the character you want to remove
.* characters, represent all the characters after that
That's it.
1Using find and replace:
- Hit CTRL-H to open the Replace dialogue box
- enter
=UUID:.*into Find what - leave Replace with empty
- Select Regular expression and .matches newline
- Click on Replace