Hi,
how can we search for a pattren between two words? below are the examples
input
1)select from table_name c1,c2,c3,c4,fn(),fn2(),c5;-->false
2)select from table_name c1,c2,c3,c4;--True
3)select from table
c1,
c2,
c3,
fn(),
c4;-->true
4)select from table_name
c1,
c2,
c3;-->true
in the above 4 examples
1) the pattren will be same each sellect will end with ; and start with "select from" in between it may have column names and function calls.
we have to search from "select from" till ; and check if functions are called inside .
2) if something with ( and ) the its function call and we should print false for that. else true.
Since my statement tests for "()" it should signal false. Do these select statements also get terminated with ;?
EDIT: I tried it and it returns false. Are you sure that is the result you are getting?
it still has problem
select some text
(select some text(select some text)
where some condition)
where condition;-->false;
select cl,c2,c3,c4,fn(),c5-->false;
select c1,c2,c3-->true;
for the first select it should be true.
for 2nd and 3rd statement its correct.
select some text
(select some text(select some text)
where some condition)
where condition;-->true
select cl,c2,c3,c4,fn(),c5;-->false
select c1,c2,c3;-->true
;
Is this not what you are getting?
Are you using Solaris?