(?si)applies the following effective flags to the remainder of the pattern: xsi s modifier: single line. Allows a dot to match line terminators
i modifier: insensitive. Matches without distinguishing uppercase and lowercase letters
^start of string
\s*any whitespace character, repeated any number of times
UPDATE the literal text UPDATE (case insensitive) \s+any whitespace character, repeated at least once
`mytable` the literal text `mytable` (case insensitive) \s+any whitespace character, repeated at least once
SET the literal text SET (case insensitive) \s+any whitespace character, repeated at least once
`keyname` the literal text `keyname` (case insensitive) \s*any whitespace character, repeated any number of times
\s*any whitespace character, repeated any number of times
'keyvalue'
the literal text 'keyvalue' (case insensitive) Comment: one or more such key = value
Atomic Group(?>
\s* , \s*
(?# field name )
` [A-Z_]+ `
(?# equals )
\s* = \s*
(?# value )
(?>
(?# an integer, possibly negative )
-? [0-9]+
|
(?# or, a string )
'
[^'\\]*
(?:
(?: \\ . | '' )
[^'\\]*
)*
'
# '
# (?: [^'\\] | '' | \\ . )*
# '
|
(?# or, literal NULL )
NULL
)
)+ +repeats the group contents below at least once:
\s*any whitespace character, repeated any number of times
\s*any whitespace character, repeated any number of times
Comment: field name
` the literal text `
+matches at least one character from the set below:
A-Zone character from A (6510) to Z (9010) (case insensitive)
_the literal _ (9510 / 1378 / 5F16)
Comment: equals
\s*any whitespace character, repeated any number of times
\s*any whitespace character, repeated any number of times
Comment: value
Atomic Group(?>
(?# an integer, possibly negative )
-? [0-9]+
|
(?# or, a string )
'
[^'\\]*
(?:
(?: \\ . | '' )
[^'\\]*
)*
'
# '
# (?: [^'\\] | '' | \\ . )*
# '
|
(?# or, literal NULL )
NULL
) 1st Alternative
(?# an integer, possibly negative )
-? [0-9]+
Comment: an integer, possibly negative
-?optionally matches the literal - (4510 / 558 / 2D16)
+matches at least one character from the set below:
0-9one character from 0 (4810) to 9 (5710)
2nd Alternative
(?# or, a string )
'
[^'\\]*
(?:
(?: \\ . | '' )
[^'\\]*
)*
'
# '
# (?: [^'\\] | '' | \\ . )*
# '
Comment: or, a string
'
the literal text '
Negated Character Class[^'\\]* *matches any number of characters outside the set below:
'the literal ' (3910 / 478 / 2716)
\\the literal \ (9210 / 1348 / 5C16)
Non-Capturing Group(?:
(?: \\ . | '' )
[^'\\]*
)* *repeats the group contents below any number of times:
Non-Capturing Group(?: \\ . | '' ) \\the literal \ (9210 / 1348 / 5C16)
.any character
Negated Character Class[^'\\]* *matches any number of characters outside the set below:
'the literal ' (3910 / 478 / 2716)
\\the literal \ (9210 / 1348 / 5C16)
'
the literal text '
Comment: '
Comment: (?: [^'\\] | '' | \\ . )*
Comment: '
3rd Alternative
(?# or, literal NULL )
NULL
Comment: or, literal NULL
NULL
the literal text NULL (case insensitive) \s+any whitespace character, repeated at least once
WHERE the literal text WHERE (case insensitive) \s+any whitespace character, repeated at least once
`keyname` the literal text `keyname` (case insensitive) \s*any whitespace character, repeated any number of times
\s*any whitespace character, repeated any number of times
'keyvalue'
the literal text 'keyvalue' (case insensitive) $end of string, or before its final line terminator
x modifier: extended. Ignores unescaped whitespace and comments outside character classes
s modifier: single line. Allows a dot to match line terminators