Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have following lines of data:




I wish to delete the string X15, the preceding +, and any characters in between using regex.

For example, the regex replace should return the following from my sample lines:




Can someone please provide some suggestions and thoughts on this?

Thank you very much.

share|improve this question

I don't know Notepad++ but the way I would do that is:



With nothing

share|improve this answer
Thanks for the response. I tried to use it, but it displays an error as "Invalid regular expression". I am quite new to regular expression. – Naren Mar 27 '14 at 3:05
I think I figured that out. Since + is a regular expression keyword, I would have to give the search string as \+[^\+]*X15 Thank you very much for help. I appreciate it – Naren Mar 27 '14 at 3:13
There are different ways that programs handle regular expressions. I didn't know if Notepad++ used + or not. Now I know. I edited my answer to reflect that. – mlv Mar 27 '14 at 11:49
@Naren You don't need to put the backslash within the negated class, that is, it's perfectly fine with \+[^+]*X15. – Jerry Mar 27 '14 at 11:53
@Naren If this answer solved your question, please select it as accepted. – Kard Nails Mar 27 '14 at 20:53

Your Answer


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.