My code is:
if (!preg_match('^http(s)?://(*)?\.mysite.com(\*)^', $url))
{
echo "<strong>Error</strong>: Invalid mysite.com link or could shorten link";
}
and I got:
Warning: preg_match() [function.preg-match]:
Compilation failed: nothing to repeat at offset 12
I am working on a link shortner, similar to bit.ly, but I only want it to shorten links from my specific site.
I need some help with this error.
The asterisk or star tells the engine to attempt to match the preceding token zero or more times.
I believe your regex pattern contains multiple errors. I suggest you to go with