Here’s my string:
SELECT x FROM Table1 WHERE (SELECT y FROM Table2 LIMIT 1) > 15 LIMIT 4
Here’s my regex:
SELECT .+ FROM .+ LIMIT (?<LIMITCOUNT>\d{1,4})
I want it to do 2 captures; one is the entire string and the other is the part in paranthesis, but it only captures the entire string. What’s my way out?
You can capture it in the lookahead
This will capture 2 queries in your example!Access it using group 1
Try it here