Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Domain URL regex help
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Rodusa  
View profile  
 More options Jun 25, 11:27 am
From: Rodusa <rlueneb...@gmail.com>
Date: Thu, 25 Jun 2009 08:27:48 -0700 (PDT)
Local: Thurs, Jun 25 2009 11:27 am
Subject: Domain URL regex help
I am trying to capture an specific domain/submain URL but I am having
a hard time trying to eliminate those last 3 options:

amazon
http
http://www

This is the regex
((?<Protocol>\w+):\/\/)?(www\.)?([a-zA-Z0-9\-\.]+)(?<extension>(\.com)?
(\.net)?(\.br)?)
This is the result I get:

http://www.amazon.com.br
http://www.ama-zon.com.br
http://www.amazon.com
http://www.amazon.net
http://amazon.com
www.amazon.com
amazon.com
product.amazon.com
http://product.amazon.com
http://www.product.amazon.com
amazon
http
http://www

thanks

Rod


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Accmailer  
View profile  
 More options Jul 13, 4:58 am
From: Accmailer <Eugeny.Satt...@gmail.com>
Date: Mon, 13 Jul 2009 01:58:05 -0700 (PDT)
Local: Mon, Jul 13 2009 4:58 am
Subject: Re: Domain URL regex help
My suggestion
\W(?:http://(?:www.)?)?([-a-z0-9_]+\.)+(com|net|br)\W

Tested on your message.
Catches all good options and does not catch the last three ones.
gTLD list can be extendedю
No need to put a dot in front of every gTLD as the ([-a-z0-9_]+\.)+
construct ensures that every word in URL (there can be really a lot of
them) is followed by a dot

Note: Will not catch URLs with subdirestories and forward slashes. If
it is required, pls reply.

On Jun 25, 8:27 pm, Rodusa <rlueneb...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google