Jump to content
Server Maintenance This Week. ×

Recommended Posts

  • Newbies

Looking for script to parse Domain Name (content between "//" and "/" of full URL).

Ideal would be to add script to existing script (pastes full URL). Parsed content to be pasted info field "Domain."

I'm a new member. Already searched the forum for "domain parser" and came up empty (surprisingly). Resources found through Yahoo search didn't work.

Thanks in advance.

Link to comment
Share on other sites

4 hours ago, Steven Thompson said:

Looking for script to parse Domain Name (content between "//" and "/" of full URL).

This would be a job for a calculation, not a script. You can use such calculation in a script, for example to do:

Set Field [ YourTable::Domain ; «the calculation» ]


Now, the calculation itself could be simply:

Let ( [
start = Position ( URL ; "/" ; 1 ; 2 ) ; 
end = Position ( URL ; "/" ; 1 ; 3 ) 
] ; 
Middle ( URL ; start + 1 ; end - start - 1 )
)

or even:

GetValue ( Substitute ( URL ; "/" ; ¶ ) ; 3 )


--
P.S. Strictly speaking, the substring between "//" and the next "/" is called the authority, and it includes the domain and optionally the port - see:
https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_URL

 

Edited by comment
  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.