ted_chou12 Posted February 4, 2007 Share Posted February 4, 2007 I want a regex function to be able to recognize url strings and therefore I can automatically change them into url links, but I am very unexpeirenced with regex, can anyone help me out please? Thanks Ted Quote Link to comment Share on other sites More sharing options...
Orio Posted February 4, 2007 Share Posted February 4, 2007 So... What's the question? Orio. Quote Link to comment Share on other sites More sharing options...
ted_chou12 Posted February 4, 2007 Author Share Posted February 4, 2007 I want a regex function to reconize url strings. thats basically it, sorry for not pointing it out at the first place. Ted Quote Link to comment Share on other sites More sharing options...
Orio Posted February 4, 2007 Share Posted February 4, 2007 I am no regex expert, and I am sure there's a better way, but I think this isn't a bad regex for URLs: preg_match("/^(http:\/\/){0,1}[a-z0-9\-]+(\.[a-z0-9\-]+)+[\/]{0,1}$/i", ...); But I may have n00b's mistakes in it! (as far as I have tested it, it's good ) Orio. Quote Link to comment Share on other sites More sharing options...
ted_chou12 Posted February 4, 2007 Author Share Posted February 4, 2007 thanks, ill take it. Ted Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.