Reworked regex implementation to fix issues with 'match at end' expressions and updated copyright notices for Meta.