Test, validate and match regular expressions
This regex matches an unescaped backslash in text, using a negative lookbehind to ensure the backslash isn't preceded by another backslash. It accounts for pairs of escaped backslashes followed by either a non-backslash character or the end of a line (with multiline flag). Commonly used for validating escape sequences in strings, detecting syntax errors in code, or finding trailing backslashes at line endings.