Unescape HTML entities last, or a tag-stripping regex eats your code
My HTML-to-text viewer showed code blocks truncated at every <. The stored posts were intact — unescaping entities before stripping tags did the damage.
My HTML-to-text viewer showed code blocks truncated at every <. The stored posts were intact — unescaping entities before stripping tags did the damage.
Without /m, a ^…$ regex accepts a value ending in a newline, in PHP preg_match and Python re alike. Strict forms: the D modifier, \z, re.fullmatch.