E
erenay
Hi, I have written a regular expression in order to choose some url
addresses that interrest me from an access log file.
I want to choose addresses that start with "http://" and end with
".html", ".htm", ".asp", ".php", ".aspx" or with a number.
The following pattern seems to only accept url's ending with ".html" or
".htm"
Does anybody has an idea why it doesn't recognize url's with other
endings?
The pattern I use is:
Pattern htmHtml = Pattern.compile("^(http://)\\S+((\\.htm) | (\\.html)
| (\\.asp) | (\\.php)| (\\.aspx) | / | (\\d))$");
It doesn't recognise the following url's:
http://www.galatasaray.org/Futbol/GS/anket/anket.asp
http://bimonline.insites.be/common/CookieCheck.asp?siteID=2382&TagId=1&Pad=tr&Lang=tr&Country=tr&b=1
http://www.aksiyon.com.tr/sonsayi210.php
It's possible that the problem is somewhere else in the code but I
wondered if you see something wrong in my pattern.
Regards,
Eren Aykin
addresses that interrest me from an access log file.
I want to choose addresses that start with "http://" and end with
".html", ".htm", ".asp", ".php", ".aspx" or with a number.
The following pattern seems to only accept url's ending with ".html" or
".htm"
Does anybody has an idea why it doesn't recognize url's with other
endings?
The pattern I use is:
Pattern htmHtml = Pattern.compile("^(http://)\\S+((\\.htm) | (\\.html)
| (\\.asp) | (\\.php)| (\\.aspx) | / | (\\d))$");
It doesn't recognise the following url's:
http://www.galatasaray.org/Futbol/GS/anket/anket.asp
http://bimonline.insites.be/common/CookieCheck.asp?siteID=2382&TagId=1&Pad=tr&Lang=tr&Country=tr&b=1
http://www.aksiyon.com.tr/sonsayi210.php
It's possible that the problem is somewhere else in the code but I
wondered if you see something wrong in my pattern.
Regards,
Eren Aykin