I need a regex to validate both default link formats in client side.
For example http://example.com and #myInternalLink are valid.
I wrote this but not working.
^(((http|https)://(([A-Z0-9][A-Z0-9_-])(.[A-Z0-9][A-Z0-9_-])+)(?::\d{1,5})?(?:$|[?/#])) | (#([A-Z0-9][A-Z0-9_-]*)))
Already answered question just solves default link formats.I want to validate both http://example.com and #myInternalLink in a same regex