how can I validate youtube channel URL using REGEX ?
I found this pattern but it doesn't work properly
Your problem is the extra pipe after
Here is the corrected regex:
The reason this is a problem is because it make (channel|user) optional.
Also, consider using a question mark for optional instead of a extra pipe, so like this
((http|https):\/\/)? instead of this