I borrowed one of the url validation expressions on the site, I tested it on site as well and it worked as expected.
However, when I copied it into my code, I added the ("/ prefix in this manner:
if (!preg_match("/(((file|gopher|news|nntp|telnet|http|ftp|https|ftps|sftp)://)|(www\.))+(([a-zA-Z0-9\._-]+\.[a-zA-Z]{2,6})|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(/[a-zA-Z0-9\&%_\./-~-]*)?/", $url))
In doing so i get this error
Warning: preg_match() [function.preg-match]: Unknown modifier '/' in /home etc etc on line 154
If I remove the first /, I then get the error telling me I have an unknown + in the code. I am sure removing that will negate the codes operation. I am sure the first / is a delimiter and
not a modifier, but I cant see anything wrong with the code i borrowed. I did review the code previous to this code and can find no mistakes.
Any suggestions for a beginner? Thanks and have a great weekend