Q:

Get part of string between specific symbols

I have got such kind of text       
select * from Table1; select * from Table2;create table Table3...sdsd; sometext===[]sometext; aaaaaaaabbbbb;select * from Table5; sdsddasdsd;

and I need to get only part of string which starts 's' and ends ';' by using Regex; Thanks.

A:

This can depend on the programming language and regex library you are using.
(s.*?;)

Should work. This will produce 1 match for each SQL statement. If you can add your language to the question it may help in case you get a different output.
The main interesting bit here is the non-greedy operator ?, which stops it matching across the whole string and matches the shortest length possible.
http://regexpal.com/ is a good place to try regular expressions.

