Regex to Make Text Links HTML Links

Regex used to select and replace URLs in plain text with clickable links

(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.%-=#~\@!]*(\?\S+)?)?)?)

PHP

$regex = '(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.%-=#~\@!]*(\?\S+)?)?)?)';
$text = mb_ereg_replace($regex, '<a href="\\1">\\1</a>', $text);

Regex Sentence Splitter

Regex to match the end of sentences in order to split a block of text into sentences.

([\.\?!][\'\"\u2018\u2019\u201c\u201d\)\]]*\s*(?<!\w\.\w.)(?<![A-Z][a-z][a-z]\.)(?<![A-Z][a-z]\.)(?<![A-Z]\.)\s+)

Python Code

sentence_regex = ur'([\.\?!][\'\"\u2018\u2019\u201c\u201d\)\]]*\s*(?<!\w\.\w.)(?<![A-Z][a-z][a-z]\.)(?<![A-Z][a-z]\.)(?<![A-Z]\.)\s+)'
regex = re.compile(sentence_regex, flags=re.UNICODE)
sentences = regex.split(TEXT_BLOCK)