our application is run on jboss in deploy we have matcher.war , actually there are some jsp, servlet and struts page and also some png, .js others. So we are not able to find subdomain URL in your way because lots of are invalid so is there any way.
From web we had perl -MFile::Find -e 'find(sub{@ARGV=($_);while(<>) {print "$File::Find:
ir : ",/((?:http\/\/\.)?www\..*)\s+/}},"/")'
but we are not able to use this one .