I need a function, that's able to count the number of links to a specific file type i.e. jpg files on an external url... The url and the type is typed into two textbox... and the system should do the count... If the type entered is .jpg and the url contains
5 ImageDescription tags, the function should return 5. Can anybody give me a clue how to do this
erm ... not sure if I understand the question completely but a regular expression may be what you need. You can do a match for the pattern you are after (with the appropriate extension) and it will tell you how many matches have been returned. Have a look at
"Expresso" (http://www.ultrapico.com/) and "Regulator" (http://royo.is-a-geek.com/iserializable/regulator/) for good tools to help test / develop the expressions. I think Expresso has some examples of finding links / URLs in it. Regulator links to www.regexlib.com
which is a library of existing expressions that may be a good place to start looking too.
That should pick up a match but the example you have just given is different to the initial example. If you want an expression that will pickup IMG elements contained in A elements then that will be a bit more complicated. You need to be clear on what should
be matched. Is it a link *to* an image or a link that is *displayed* as an image?
Allright.... I tried it with Expresso.... Works without syntax errors, but it seems, that it finds more than just the image links.... For example the link below will be included in the result:
You may need to play about with it a bit. I suspect some of the matches need to be "Zero or more" rather than "One or more", esp after the bit matching the href="target" bit (before the '>' character.
None
0 Points
10 Posts
Counting specific links on an external URL
Apr 18, 2004 05:56 AM|nordestgaard|LINK
None
0 Points
110 Posts
Re: Counting specific links on an external URL
Apr 18, 2004 01:27 PM|intesoft|LINK
ASPAccelerator.NET - Fewer bytes, faster pages
ASPRedirector.NET - Put friendly URLs on your site
None
0 Points
10 Posts
Re: Counting specific links on an external URL
Apr 18, 2004 05:02 PM|nordestgaard|LINK
None
0 Points
10 Posts
Re: Counting specific links on an external URL
Apr 19, 2004 05:07 AM|nordestgaard|LINK
None
0 Points
110 Posts
Re: Counting specific links on an external URL
Apr 19, 2004 08:14 AM|intesoft|LINK
ASPAccelerator.NET - Fewer bytes, faster pages
ASPRedirector.NET - Put friendly URLs on your site
None
0 Points
10 Posts
Re: Counting specific links on an external URL
Apr 19, 2004 08:31 AM|nordestgaard|LINK
None
0 Points
110 Posts
Re: Counting specific links on an external URL
Apr 19, 2004 09:27 AM|intesoft|LINK
ASPAccelerator.NET - Fewer bytes, faster pages
ASPRedirector.NET - Put friendly URLs on your site
None
0 Points
10 Posts
Re: Counting specific links on an external URL
Apr 19, 2004 09:38 AM|nordestgaard|LINK
None
0 Points
110 Posts
Re: Counting specific links on an external URL
Apr 19, 2004 10:39 AM|intesoft|LINK
ASPAccelerator.NET - Fewer bytes, faster pages
ASPRedirector.NET - Put friendly URLs on your site
None
0 Points
10 Posts
Re: Counting specific links on an external URL
Apr 19, 2004 10:55 AM|nordestgaard|LINK
None
0 Points
110 Posts
Re: Counting specific links on an external URL
Apr 19, 2004 12:47 PM|intesoft|LINK
ASPAccelerator.NET - Fewer bytes, faster pages
ASPRedirector.NET - Put friendly URLs on your site
None
0 Points
10 Posts
Re: Counting specific links on an external URL
Apr 19, 2004 01:14 PM|nordestgaard|LINK
None
0 Points
110 Posts
Re: Counting specific links on an external URL
Apr 19, 2004 03:32 PM|intesoft|LINK
ASPAccelerator.NET - Fewer bytes, faster pages
ASPRedirector.NET - Put friendly URLs on your site
None
0 Points
10 Posts
Re: Counting specific links on an external URL
Apr 20, 2004 05:16 AM|nordestgaard|LINK
None
0 Points
110 Posts
Re: Counting specific links on an external URL
Apr 20, 2004 07:59 AM|intesoft|LINK
ASPAccelerator.NET - Fewer bytes, faster pages
ASPRedirector.NET - Put friendly URLs on your site
None
0 Points
10 Posts
Re: Counting specific links on an external URL
Apr 20, 2004 08:45 AM|nordestgaard|LINK
None
0 Points
110 Posts
Re: Counting specific links on an external URL
Apr 20, 2004 05:09 PM|intesoft|LINK
ASPAccelerator.NET - Fewer bytes, faster pages
ASPRedirector.NET - Put friendly URLs on your site