Regex to get root domain?

Daikaiser

Client
Регистрация
06.09.2011
Сообщения
68
Благодарностей
9
Баллы
8
Hi, how can I get the root domain of an url using regex? For example, I have a list of urls like facebook.com/test/ and I want to get only facebook.com
I tried using regex for the extensions of the url, but I was unable to create a regex that will grab the portion of text ending in .com or .net or .org
How do you put in regex if A or B or C appears? Thanks
 

Daikaiser

Client
Регистрация
06.09.2011
Сообщения
68
Благодарностей
9
Баллы
8
(.*\.com|.*\.net|.*\.org)

I finally got it working with the previous regex. For any people having the same issue, I just made an individual regex using the designer for each condition (text ending in .com, .net, .org), and separated them by " | ". Then I put everything between ( ) .Hope this helps anyone who doesn't known regex like me :-)
 

mdsurfer

Client
Регистрация
31.01.2012
Сообщения
52
Благодарностей
1
Баллы
8
Did you try this {-Page.FullDomain-} ?
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)