Documention for: extract-urls.r Created by: chrisrg on: 29-Nov-2009 Last updated by: chrisrg on: 14-Dec-2009 Format: text/editable Downloaded on: 30-Apr-2025 Extract URLs Separates URLs from the body of plain text. Inspired by John Gruber (except REBOL doesn't do Regex): =url http://daringfireball.net/2009/11/liberal_regex_for_matching_urls A Liberal, Accurate Regex Pattern for Matching URLs This function returns a block containing strings and urls. ===Example Usage: do %extract-urls.r sanitize: func [str][ foreach [fr to][ "&" "&" "<" "<" "^"" """ ][ replace/all str fr to ] ] link-up: func [str][ foreach part extract-urls str [ append "" either url? part [ rejoin [{} part {}] ][ sanitize part ] ] ] This will take a plain text string and replace URLs with HTML link tags. ###