I’m trying to finish up my assignment and only last one is to validate the URL
The requirement is as follow:
url only allows alphanumerical characters and the following :/.~?=+& No two periods can exist consecutively.
here is what I have so far but it doesn’t work
m|(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?|
So what happen now that anything I enter it just pass the matching process that I do which is something like this
$return = $search =~ m|(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?|;
so it always return true for me even I just type nothing in the search box.
Here is what I’m getting from my regex turbulator (soon to be a commercial product)
Without group count
With group count