Usually I don\'t even bother posting comments on such snippets, but well here goes:
Why do you use (0 isin %PV)? Did you know this if statement also validates when %pv is 10? or when %pv is 20? Heck every number which contains a zero. This is obviously not what you want, so stop using isin and start using ==.
There is more wrong, but for now bother with this only.
The $replacecs looks weird and out of order, I don\'t really see why you hard coded an acronym in your code. You say: \"Note: The acronyms thank you and no problem are already inputed in the main part of the alias do to regex\'s case sensitive nature\". Well, the truth is, regex is as case (in)sensitive as you specify it to be. If you use the /i switch, it will make the check case insensitive, which is probably what you are looking for.
test#test is a valid anchor (not 2 anchors, 1 anchor with # in it), it may be considered obsolette by some browsers, but EVEN firefox considers it as a valid anchor (just tested it).
So you are basically saying that whatever protocol is used, it is a valid url (http1://, httpmrc://, bla://) even though they don\'t exist and no browser can display them?
And I just noticed that you consider sites with the ~ in it NOT a valid url. I think you misunderstood http://www.ietf.org/rfc/rfc1738.txt, UNSAFE != INVALID. Here just visit this site as an example http://www.let.uu.nl/~ctl/ I\'m pretty sure that whatever browser you use, it will open the site. And surely the creators of your browser know better of what url is valid and what url is invalid.