-1

We are looking for a regular expression that returns the names of the SQL-Select Fields: 1 fixedValue Custno CustName (can be separated with , ; etc.)

select 
1, 
'test' as fixedvalue , 
tbl.s_no as custno , 
ltrim(rtrim(isnull(tbl.s_name1, '') + ' ' + isnull(tbl.s_name2, ''))) as custname 
from tbl

Thanks in advance ;)

1 Answers1

0

See if this wroks for you

\w*\s*as\s([a-zA-Z]*)
Aditi
  • 1,188
  • 2
  • 16
  • 44
  • preg_match_all returns the following, is it possible to get the "1" too ? ( [0] => Array ( [0] => as fixedvalue [1] => s_no as custno [2] => as custname ) [1] => Array ( [0] => fixedvalue [1] => custno [2] => custname ) ) – Alexander Novotny Feb 25 '13 at 09:27