Remove use of regexp when start_with / lastIndexOf is better and fix a discrepancy regarding public channel detection