Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

Need some help with regula expression

Last post 10-27-2008, 7:53 PM by Ennio. 3 replies.
Sort Posts: Previous Next
  •  10-27-2008, 1:42 PM 47645

    Need some help with regula expression

    I need a regular expression to do the following.

     I have a variable called $base, that contain an url (http://www.mysite.com/)

     I need a regular expression that will check in the list of link if the list contain $base + index or default ( it need to get all type of document example (inde.html, default.html, index.asp, index.aspx, etc.)

    Thanks

    Filed under: , ,
  •  10-27-2008, 3:54 PM 47653 in reply to 47645

    Re: Need some help with regula expression

    I have this so far and looks like it's working. I'm using it in PERL

     

    m/($base)(index.|default.)/

    When I print the list it removes all the index.html, index.asp,....

    Is that correct? or Is there a better way to do this.

     

    Thank you..

  •  10-27-2008, 5:01 PM 47661 in reply to 47653

    Re: Need some help with regula expression

    Not quite sure what your question is, but if your solution passes all your tests, then I guess it's correct!

    ; )

  •  10-27-2008, 7:53 PM 47671 in reply to 47661

    Re: Need some help with regula expression

    I'm trying to remove self-referencing link from a list of links.

    example if I'm looking at links from http://www.mysite.com/ and I found this link on the list http://www.mysite.com/index.html it's a self-referencing link, so I don't need and I can skip it.

     

     

View as RSS news feed in XML