0

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/">

2
  • 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, 2012 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, 2012 at 16:16

2 Answers 2

1

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

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

0

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"

3
  • 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, 2012 at 17:03
  • i figured it out, correct search string is <a href="(.*).website.com/">
    – John
    Jun 3, 2012 at 17:39
  • I don't use notepad++, some of their conventions seem to be non-standard.
    – Rob
    Jun 3, 2012 at 17:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .