Hello,
I am trying to filter the data in a form's input field.
Specifically, I am trying to remove the TLD (.com,.net...) from a domain name.
For example, somone enters: gossamer-threads.com
I only want: gossamer-threads
I am working with the following code:
$domainname =~ s/\.[com|net|org]//i;
$page_html =~ s/%domainname%/$domainname/gi;
The problem is that the code returns: gossamer-threadsom (only stripping the .c of .com).
Any thoughts?
Sean
I am trying to filter the data in a form's input field.
Specifically, I am trying to remove the TLD (.com,.net...) from a domain name.
For example, somone enters: gossamer-threads.com
I only want: gossamer-threads
I am working with the following code:
$domainname =~ s/\.[com|net|org]//i;
$page_html =~ s/%domainname%/$domainname/gi;
The problem is that the code returns: gossamer-threadsom (only stripping the .c of .com).
Any thoughts?
Sean