[Solved] (Python/ Regular Expression) How to select text between two given words?

[ad_1]

You can use

(?:SELECT\s*)(.*?)(?:,\s*SUM.*)

to create a single capturing group.

The two (?:...) make non-capturing groups.
The (.*?) is a non-greedy group, which will stop before the FIRST “SUM” instead of the last one.

0

[ad_2]

solved (Python/ Regular Expression) How to select text between two given words?