/
(?xXmi)
(?:
(?# use non-capture for details in debugging)
(?:
(?<match>
(?# If quoted value)
(?<quot_char>(?<!\\)["'])
(?# Quoted content)
(?:
(?:
(?# Match as many characters that aren't quotation char)
(?# or escape char as possible. )
(?:(?:(?!\k<quot_char>|\\)).+)
(?:
(?# Match any/all escape chars that do not have the)
(?# quotation char following it. )
(?:(?:\\)*(?!\k<quot_char>))?
(?# If there is an escape char followed by the quotation)
(?# quotation char match them.