(?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) \sany whitespace character
\sany whitespace character
'keyvalue'
the literal text 'keyvalue' (case insensitive) Group 1( # (1 start)
(?>
, \s+ ` [A-Z_]+ `
(?# field name )
\s+ = \s+
(?# equals value )
(?:
-? [0-9]+
(?# an integer, possibly negative )
|
'
(?> [^'\\]+ | \\ . | '' )*
'
# '
# [^'\\]*
# (?:
# (?: \\ . | '' )
# [^'\\]*
# )*
# '
(?# a string in single quotes )
| NULL
(?# NULL )
)
)+
) Comment: (1 start)
Atomic Group(?>
, \s+ ` [A-Z_]+ `
(?# field name )
\s+ = \s+
(?# equals value )
(?:
-? [0-9]+
(?# an integer, possibly negative )
|
'
(?> [^'\\]+ | \\ . | '' )*
'
# '
# [^'\\]*
# (?:
# (?: \\ . | '' )
# [^'\\]*
# )*
# '
(?# a string in single quotes )
| NULL
(?# NULL )
)
)+ +repeats the group contents below at least once:
, the literal text ,
\s+any whitespace character, repeated at least once
+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: field name
\s+any whitespace character, repeated at least once
\s+any whitespace character, repeated at least once
Comment: equals value
Non-Capturing Group(?:
-? [0-9]+
(?# an integer, possibly negative )
|
'
(?> [^'\\]+ | \\ . | '' )*
'
# '
# [^'\\]*
# (?:
# (?: \\ . | '' )
# [^'\\]*
# )*
# '
(?# a string in single quotes )
| NULL
(?# NULL )
) 1st Alternative
-? [0-9]+
(?# 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)
Comment: an integer, possibly negative
2nd Alternative
'
(?> [^'\\]+ | \\ . | '' )*
'
# '
# [^'\\]*
# (?:
# (?: \\ . | '' )
# [^'\\]*
# )*
# '
(?# a string in single quotes )
'
the literal text '
Atomic Group(?> [^'\\]+ | \\ . | '' )* *repeats the group contents below any number of times:
Negated Character Class[^'\\]+ +matches at least one character outside the set below:
'the literal ' (3910 / 478 / 2716)
\\the literal \ (9210 / 1348 / 5C16)
\\the literal \ (9210 / 1348 / 5C16)
.any character
'
the literal text '
Comment: '
Comment: [^'\\]*
Comment: (?:
Comment: (?: \\ . | '' )
Comment: [^'\\]*
Comment: )*
Comment: '
Comment: a string in single quotes
3rd Alternative NULL
(?# NULL )
NULL
the literal text NULL (case insensitive) Comment: NULL
Comment: (1 end)
Comment: one or more such assignments
\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 at least once
\s+any whitespace character, repeated at least once
'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