You are not logged in.
Announcement
Unanswered posts
|
Pages: 1

Hi,
How can I get the domain name from the string having multiple sub domains?
I'm using tExtractRegexFields component for string filtering.
Below is my Regular Expression to filter the URL string:
"^(https?|ftp|file)://([-a-zA-Z]*).([-a-zA-Z0-9+&@#%?=~_|!:,.;]*)/(^$|[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*)"
It works fine but cannot handle if the URL having few Sub Domains, e.g; stk.se.search.yahoo.com/page?q=abc
I also have to be sure, in which column will I find "Yahoo.com" using tExtractRegexFields, having above example in mind.
Any solution?
Thanks!
Last edited by ilyasiqbal (2012-07-19 09:30:40)
Offline

Hi,
Thanks for that. But I think it cannot help solving the problem and the problem is, not to handle only one specific domain name with .com. I have to make it generic to handle all kind of TLDs e.g;
.com, .se , .us .. etc..
and SubDomains e.g;
se.search.yahoo.com
search.google.se
se.ask.com
etc....
AND Then... I also have to be sure, in which column of tExtractRegexFields will I find "Yahoo.com" or "Google.se" or "Ask.com" , having above example in mind.
That means, when you split a string, it goes into different columns of tExtractRegexFields, and to get the last resultant string, it should refer to only one specific column, which I will use to Insert that into a specific table, later on.
Offline

Hi
You might use it like this.
"(\\w*
/)?((\\w*\\-)*\\w*\\.(com|se|com.us|org)).*$"
Add domains as much as you can.
As far as I know, this is the only way to check root domain....
Regards,
Pedro
Offline

Hi
Thanks for your guidence.
Is it also possible to fetch QueryString by extending this ReEx?
"(\\w*
/)?((\\w*\\-)*\\w*\\.(com|se|com.us|org)).*$"
e.g; to handle: se.search.yahoo.com/lp.php?a=22&b=44
so that I can get it like:
yahoo.com|a=22&b=44
Offline

Hi
Actually from above regex, i get a domain name. Based on that I make an SQL Query to fetch a parameter. That param will use to get a certain value from QueryString.
And doing it with another regex, i'll have to write the same query again, which may effect the speed.
Is there a way that I can set a value in Global variable, and can access it anywhere in the job?
Offline

how can I make a context variable? please guide me.
Offline

most of the available material on web regarding Context Variables is about tFixedFileInput etc... where I'm using tMap and tMySQLInput...
Offline
Pages: 1