function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DJ 367DJ 367 

Regex code for URL https://(anything).test.com/(anything)

Hello All,

Can someone please help me to wrtie Regex in the URL format as below. Thanks

 URL:  https://(anything).test.com/(anything)
Khan AnasKhan Anas (Salesforce Developers) 
Hi,

Greetings to you!

Please use below line of code:
IF(REGEX(URLfield__c,"^(https:\/\/)[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.(test)\.(com)(:[0-9]{1,5})?(\/.*)?$"),false,true)

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Thanks and Regards,
Khan Anas