regex question/fix - 20/10/08 06:55 PM
I'm using the piece of code underneath to log and load urls, ftp links and such like into a simple dialog.
The problem i have just picked up on, It'll only log the first link, and not the rest if they are more on 1 line, would be greatful for a fix for this. Thanks.
The problem i have just picked up on, It'll only log the first link, and not the rest if they are more on 1 line, would be greatful for a fix for this. Thanks.
Code:
on ^1:TEXT:*:?:{ var %input = $strip($1-) var %url $regml($regex(%text,/((?:ftp:\/\/|https?:\/\/|www2?\.)[^<>\.\s]+(?:\.[^<>\.\s]+)+(?:\/[^<>\.\s]+)*)/g)) if ($regml($regex(%text,/((?:ftp:\/\/|https?:\/\/|www2?\.)[^<>\.\s]+(?:\.[^<>\.\s]+)+(?:\/[^<>\.\s]+)*)/g))) { if ($read(system\url.txt,w,$regml(1)) == $null) { write system\url.txt $regml(1) } if ($dialog(url)) { loadbuf -ro url 1 system\url.txt } haltdef } }