I have a program that goes through SQL statements, identifying component parts with a space. eg: -
SELECT * FROM tblSales WHERE CustomerID=10 AND Year=2011
Would produce the following as separate components: -
"SELECT","*","FROM","tblSales","WHERE","CustomerID=10","AND" and "Year=2011"
The problem I have however is the use of spaces within values eg.:-
SELECT * FROM tblSales WHERE CustomerNameID='Test Company' AND Year=2011
Using the same space-separating logic, this would produce components of: -
"SELECT,"*","FROM","tblSales","WHERE","CustomerID='Test","Company'","AND" and "Year=2011".
ie the space between "Test" & "Company" causes it to be treated as two separate components.
Question is, Is it possible via RegEx.Replace to replace the spaces between the quotation marks with another character whilst leaving all other spaces in the string in tact?
Shaun.