fork download
  1.  
  2. using System;
  3. using System.Text.RegularExpressions;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. string strModifiedQuery = @"SELECT TAB1.Key
  10. FROM TAB1 IN 'C:\TEST\SAMPLE\HELLO.mdb'
  11. ORDER BY TAB1.Key;";
  12. string result = Regex.Replace(strModifiedQuery, @"(?i)(?s)(.*?)\S+\s*\S+\s*'\w:\\\w+\\\w+\\(\w+)\.(?:mdb|accdb)'", "$1[$2].TAB1");
  13. Console.WriteLine(result);
  14. Console.ReadLine();
  15. }
  16. }
Success #stdin #stdout 0.08s 34176KB
stdin
Standard input is empty
stdout
SELECT TAB1.Key
FROM [HELLO].TAB1
ORDER BY TAB1.Key;