Check if string is a valid URL
JavaScript, 114 bytes

x=&gt;RegExp(`^(?!.*([./](-|(?!xn)[^/]{2}--)|-[./]|-$))https?://${a='[a-zA-Z0-9-]{0,63}'}(?:\\.${a}){0,127}`).test(x)


Hopes it works.

For real URLs, you should use:

x=&gt;eval(`try{new URL(x)}catch(e){}`)


Thanks to ThePirateBay, construct regex from string save 3 bytes.