Test, validate and match regular expressions
This regex matches string literals enclosed in either single or double quotes, ensuring that any escaped characters within the strings are properly handled. It uses a backreference to guarantee that the closing quote matches the opening one. This is particularly useful for parsing SQL queries or code snippets where accurate extraction of string literals is required, such as in tools generating unique SQL statements.