Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have several lines of code and I'm looking for a way to search for a specific string e.g. 'id0=' and delete it and all 10 characters after it, per line. I would prefer a way/macro/addon for notepad++. But all other tools or scripts are welcome.

Note that ideally I'd like to delete and replace it with a 32 character string throughout the file, but for now, I'm just trying to get over the 1st hump, which is to delete it

Before

://81.88.22.6/*=id0=CB5B9C00BA
://*-ad.cgi*=time=3C8EFF48B674A820E7
://*-ads/*=id0=0D6CF7D5BE

Note that the patterns (numbers & characters) I'm looking for are always different per line and are not on every line so you couldn't do a search 'n replace with them.

Should look like this after

://81.88.22.6/
://*-ad.cgi*=time=3C8EFF48B674A820E7*
://*-ads/

I've tried this method, (try =id0=[0-9A-Z]{10}), which I've found on this site, but it's not working for me.

I'm using Notepad++ and in the replace GUI, I click on regular expression (radial button), then under Find I put id0=[0-9A-Z]{10} and leave the Replace field blank, but it does NOT seem to recognize id0=[0-9A-Z]{10} – it's not finding any!

share|improve this question

1 Answer 1

Interesting, Notepad++ does not seem to understand the {10}. But see if this works out for you, it seemed to in my quick test:

id0\=\w\w\w\w\w\w\w\w\w\w

You have to escape the = sign i believe and the \w is just any one alphanumeric char or underscore.

This helped me:

http://blog.creativeitp.com/posts-and-articles/editors/understanding-regex-with-notepad/

share|improve this answer
    
This: id0=[0-9]{10} and you've suggested above seemed to work! Thanks Bro! –  Paul M Nov 11 '12 at 21:39
    
You're welcome. Please mark an answer as the correct one then. Cheers –  TheUser1024 Nov 11 '12 at 23:04
    
"Please mark an answer as the correct one" how do I do that? –  Paul M Nov 13 '12 at 2:51
    
No precise idea, didnt ask any questions yet. Should be easy enough to find i think. Maybe someone else can point you in the right direction. –  TheUser1024 Nov 13 '12 at 18:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.