To remove www, http, and https, you must use replace as follows:
string.replace( /www|https?/ , '');
?
indicates that s is optional whether or not it exists and if it exists it will be replaced.
The |
is the conditional or