2

I have some URL look likes:

<loc>http://www.website.com/category/keyword1-keyowrd2-v894545</loc>
<loc>http://www.website.com/category/keyword1-v3650159</loc>
<loc>http://www.website.com/category/keyword1-keyword2-keyword3-v35460159</loc>

How to remove "-v894545", "-v3650159", and "-v35460159" at last of URL in notedpad ++ ? Thank you very much !

2
  • Sorry, It doesn't work ! Commented Oct 18, 2014 at 8:09
  • I've tried out @vks solution, and it worked for me. Put -v\d+$ in the Find what input box, and an empty string to the Replace with. Search mode: regular expresson. And click replace all. Commented Oct 18, 2014 at 8:12

2 Answers 2

1
-v\d+$

Try this.Replace with empty string.

Sign up to request clarification or add additional context in comments.

3 Comments

Yes, your code works with old URL. However, I changed my URL. So, how to apply it with my new URL. Sorry, it is my mistake !
@Jee try -v\d+(?=\s*<)
try -v\d+(?=\s*<\/[^<>]*>$)
1

If you want to remove the last part of the string along with -, do :

1. Open replace window
2. Select `Wrap Around` checkBox and `Regular Expression` radio button.
3. Put `-[^\-]+$` in `Find what` text field and `</loc>` in `Replace with`
4. Press `Replace All`  

3 Comments

change your Regex -[^\-]+$ with -v\d+. Or Replace with = </loc>
Thank you very much ! I can't +1 for you because of my reputation. Sorry !
u don't have to be, but soon you will be able to. Cheers :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.