using System;
using System.IO;
using System.Text.RegularExpressions;
public class Test
{
public static void Main()
{
var str = "FIND files where file2=29 AND file32=\"12\" OR file623134=\"file23\"";
var rx = new Regex(@"\bfile(\d+)=""?(\w+)""?");
var result = rx.Replace(str, "(FILE_ID=$1 AND FILE_VALUE=$2)").Replace("FIND files where", "SELECT * FROM [FILES] WHERE");
Console.WriteLine(result);
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uSU87CnVzaW5nIFN5c3RlbS5UZXh0LlJlZ3VsYXJFeHByZXNzaW9uczsKCnB1YmxpYyBjbGFzcyBUZXN0CnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBNYWluKCkKCXsKCQl2YXIgc3RyID0gIkZJTkQgZmlsZXMgd2hlcmUgZmlsZTI9MjkgQU5EIGZpbGUzMj1cIjEyXCIgT1IgZmlsZTYyMzEzND1cImZpbGUyM1wiIjsKCQl2YXIgcnggPSBuZXcgUmVnZXgoQCJcYmZpbGUoXGQrKT0iIj8oXHcrKSIiPyIpOwogICAgICAgIHZhciByZXN1bHQgPSByeC5SZXBsYWNlKHN0ciwgIihGSUxFX0lEPSQxIEFORCBGSUxFX1ZBTFVFPSQyKSIpLlJlcGxhY2UoIkZJTkQgZmlsZXMgd2hlcmUiLCAiU0VMRUNUICogRlJPTSBbRklMRVNdIFdIRVJFIik7CiAgICAgICAgQ29uc29sZS5Xcml0ZUxpbmUocmVzdWx0KTsKCX0KfQ==