How about a new regex?
![]() ![]() |
Sometimes...
var regex = /\b(?![\@\s]+)(https?:\/\/)?([\w-]+\.)?[\w-]+\.(dk|com|net|org|se|no|nl|us|uk|de|it|nu|edu|info|co\.nr|(co\.)?in|to|fr|gov|biz|tv|co\.|mil|hu)(\/[^ ]*)?\b/gi, ...fails. Example stu nicholls | CSS PLaY | 100% wide/high 'background' image emulation
It linkifies "http://www.cssplay.co." - which is odd. For now I'm giving up on your script since a bad regex is - well - a bad regex. I'm going to give this script a whirl: Text to Link
___________________
The advantage of your script is that it avoids certain tags - like PRE. I just learned that "Text to Link" doesn't avoid the stuff inside PRE. |
![]() ![]() |
First of all, the regex wasn't created by me, I only slightly edited it.
Second of all, it's because that specific domain isn't in the regex. I will add it when I have more time to dissect the regex and make it more dynamic. Third of all, how are you to say it's a bad regex? Since when did you know a bad regex from a good regex? You learned a lot of regex from me, I can see it in your code, so if you do know bad from good, then please, make a good regex for this. If not, I will update the regex to fit that domain and upload it. This script wasn't made by me, but I'm slowly making improvements in my free time. Remember, I have over 200 other scripts to maintain as well. For now, I edited it to fix your specific co.uk domain problem. If you know any other un-added 2 part domains (i.e., co.uk co.nr co.in), please inform me and I will add them. |

