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.

It isn't working. I hit CTRL+F selected "regular expression" and searched for href=".*\.website\.com" I found nothing I need to search for all instances of <a href="xxxx.website.com/"> where xxxx changes, is of variable length and doesn't contain a .

I need it to find

<a href="cars.website.com/">

<a href="beach.website.com/">

<a href="breadloaves.website.com/">

but not <a href="nice.cars.website.com/">

i figured it out, correct search string is <a href="(.*).website.com/">

share|improve this question
    
notepad++ uses regexs (the latest version uses PERL regex) They can be confusing, if you edit examples of you want you want to find into the post, we can try to help you make a regex to find them. –  Rob Jun 3 '12 at 15:54
1  
I put the example into the post when i made it, but since it was html it didn't show. When I want to edit it, someone had already edited out the html, thinking it was spam or something. –  John Jun 3 '12 at 16:16
add comment

2 Answers

up vote 1 down vote accepted

href="[^.]*\.website\.com\/" should work.

[^.] finds any character, except dots. If you use .*, the regex also matches <a href="nice.cars.website.com/">.

share|improve this answer
add comment

In notepad++, hit CTRL + F to open the find menu, make sure the radio option for regular expressions and selected, and do a search for href=".*\.website\.com"

share|improve this answer
    
It isn't working. I hit ctrl+f selected "regular expression" and searched for href=".*\.website\.com" I found nothing I need to search for all instances of href="xxxx.website.com/"; where xxxx changes, is of variable length and doesn't contain a . (dot) –  John Jun 3 '12 at 17:03
    
i figured it out, correct search string is <a href="(.*).website.com/"> –  John Jun 3 '12 at 17:39
    
I don't use notepad++, some of their conventions seem to be non-standard. –  Rob Jun 3 '12 at 17:47
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.