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 am trying to edit a series of strings in Notepad++ using search & replace. What I'd like to do is to search for a particular piece of HTML code, then delete a portion of it. The challenging part is that one word in the code segment varies.

For example, I'd like to find every instance of this:

/arama.php?shoes=bile 

(where "shoes" could be any word of varying length - sandals, boots, slippers, flipflops, etc.)

and replace it with just

/shoes=bile 

(where "shoes" is whatever the original word in that position of the string is).

Is this possible? Any ideas how?

share|improve this question
2  
I thought np++ could handle full regex... –  ratchet freak Dec 15 '11 at 20:03
    
Learn searching with regular expressions, aka regex. –  mtone Dec 15 '11 at 20:19
    
Any good ideas of where to go to learn more? I tried using an asterisk (*) as a wildcard, but that doesn't work. I've used '?' in other programs, but when the string is of variable length, that doesn't work. I've tried searching the web for solutions, but haven't found anything, which is why I posted here. –  Scoop Dec 15 '11 at 20:27
    
Wouldn't removing arama.php? from the string suffice? –  slhck Dec 16 '11 at 14:28
add comment

1 Answer

you can use regex for this as others have suggested:

try something like

/arama.php\?([a-zA-Z]+)=([a-zA-Z]+)

replacement line would look something like

/\1=\2
share|improve this answer
    
THanks for the help. THat got me going! –  Scoop Dec 17 '11 at 0:55
    
If the solution was what you were looking for, please mark it answered. –  BLSully Dec 19 '11 at 21:30
add comment

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.