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 some URL like the following

What I want is to simple delete all of the text before and after the number 1343381 which is an ID.

I read that I could do this using Notepad++ Regular Expressions. Any ideas?

share|improve this question

If we can assume that SOMEURL and first-category don't contain digits, we can simply search for the first non-empty string of numbers and delete everything else.


Find what:    (.*?)(\d+).*
Replace with: \2

How it works:

  • .* is any arbitrary string of characters

  • ? makes .* lazy, i.e., it matches as few characters as possible

  • \d+ is a non-empty string of digits

  • () groups characters, where \2 refers to the second group

For more information about Regular Expressions, click here.


gets replaced with

share|improve this answer

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.