re: Need help cleaning up this code, which modifies the subdomain. VIEW POST

TOP OF THREAD FULL DISCUSSION
re: var subdomainMatch = /^[^.]+\./; var admin = window.location.host.replace(subdomainMatch, "admin."); This is using a regex, but at least it is ...
 

gorgeous! I love me some regex. I was trying to do this yesterday but going about it all wrong. I was trying to abstract out the last part of the domain. Should have made it easy on myself and just find/replace the subdomain! Thank you!

code of conduct - report abuse