^start of string
selectthe literal text select (case insensitive) \s+any whitespace character, repeated at least once
Group columns(?<columns>.*?) .*?any character (except for line terminators), repeated any number of times
\s+any whitespace character, repeated at least once
fromthe literal text from (case insensitive) \s+any whitespace character, repeated at least once
?repeats the group contents below at most once:
.*?any character (except for line terminators), repeated any number of times
Group 3((where\s+(?<where>.*?))?(order by\s+(?<order>.*?))?(limit\s+(?<limit>(.*?)))?) Group 4(where\s+(?<where>.*?))? ?repeats the group contents below at most once:
wherethe literal text where (case insensitive) \s+any whitespace character, repeated at least once
.*?any character (except for line terminators), repeated any number of times
Group 6(order by\s+(?<order>.*?))? ?repeats the group contents below at most once:
order bythe literal text order by (case insensitive) \s+any whitespace character, repeated at least once
.*?any character (except for line terminators), repeated any number of times
Group 8(limit\s+(?<limit>(.*?)))? ?repeats the group contents below at most once:
limitthe literal text limit (case insensitive) \s+any whitespace character, repeated at least once
Group limit(?<limit>(.*?)) .*?any character (except for line terminators), repeated any number of times
;the literal ; (5910 / 738 / 3B16)
g modifier: global. Finds all matches instead of stopping after the first
i modifier: insensitive. Matches without distinguishing uppercase and lowercase letters