New topic: RegEX URLS
<http://forums.realsoftware.com/viewtopic.php?t=45973> Page 1 of 1 [ 3 posts ] Previous topic | Next topic Author Message simulanics Post subject: RegEX URLSPosted: Sun Nov 18, 2012 1:17 pm Joined: Sun Aug 12, 2007 10:10 am Posts: 848 Location: Boiling Springs, SC I have a function to highlight urls in some text..but it doesn't always hightlight correctly...if the url is at the end of a sentence followed by a linebreak, it will highlight the url and the following word on the next line...sometimes it will highlight before the url. I've tried adding boundaries..and avoidance of whitespace but it breaks the regex... this is what i have...how can I fix it to ONLY highlight a url and skip any spaces or line breaks following or before the URL? ((http|https|ftp)\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(:[a-zA-Z0-9]*)?/?([a-zA-Z0-9:\-\._\?\,\'/\\\+&%\$#\=~])*[^\.\,\)\(\s]) have also tried ((https?|ftp|file)://|www\.|ftp\.)[-A-Z0-9+&@#/%?=~_|$!:,.;]*[-A-Z0-9+&@#/%=~_|$] but doesn't work as it should...unless I'm missing something... _________________ Matthew A. Combatti Real Studio 2012 r1.2 Visit Real Studio Developer's Spot! Systems I Use: Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8 Beta Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/ Windows Server 2011/CentOS 5.4 /ReactOS/SimOS ~All REAL Compatible~ Top p0wn3d Post subject: Re: RegEX URLSPosted: Sun Nov 18, 2012 3:36 pm Joined: Sun Oct 28, 2012 4:54 am Posts: 19 being a complete N00B maybe the (S) I will no doubt be wrong just trying to help ((https(s)|ftp|file)://|www\.|ftp\.)[-A-Z0-9+&@#/%?=~_|$!:,.;]*[-A-Z0-9+&@#/%=~_|$] Top p0wn3d Post subject: Re: RegEX URLSPosted: Sun Nov 18, 2012 3:49 pm Joined: Sun Oct 28, 2012 4:54 am Posts: 19 or ((http(s)|ftp|file)://|www\.|ftp\.)[-A-Z0-9+&@#/%?=~_|$!:,.;]*[-A-Z0-9+&@#/%=~_|$] Maybe? Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 3 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
