$re = '/([\'""])((?:\\\\1|(?:(?!\1)).)*)(\1)|(?<OpenMatch>({))|(?<CloseMatch>(}))/m';
$str = 'if (!(new[] { "Command", "Click" }).Any(d => xmlAttribute.Name.Equals(d,
StringComparison.CurrentCultureIgnoreCase))) continue;
if (!baseChain.Name.Contains(\':\')) return chain;
var checkAnyInherited = baseChain.Name.Split(\':\').Last().Split(\',\', \' \').Where(d => !string.IsNullOrEmpty(d)).Select(d => d.Trim()).ToList();
private static IEnumerable<StatementReferenceMaster> GetAllMethodsForClass(string className, int projectId)
{
using (ICodeVortoService codeVortoService = new CodeVortoService())
{
object[] parametersExp =
{
new MySqlParameter("@delim", MySqlDbType.VarChar) {Value = ","},
new MySqlParameter("@className", MySqlDbType.VarChar) {Value = className},
new MySqlParameter("@prjId", MySqlDbType.Int32) {Value = projectId}
};
var callExtExpandedCode = codeVortoService.StatementReferenceMasterRepository
.ExecuteStoreProcedure<StatementReferenceMaster>("SpGetAllMethodsForClass", parametersExp)
.ContinueWith(t => t.Result).Result;
return callExtExpandedCode;
}
}
@"CREATE\\s+TABLE"
@"\\`(.*?)\\`\\s+\\("
@"^\\`(.*?)\\`(.*)"
@"^PRIMARY\\s+KEY"
@"(.*)\\((.*)\\)"
""
""
""
"("
"-"
"DbScript"
@"CREATE\\s+TABLE\\s+(\\[dbo\\].)?(\\[)?(\\`)?(?<TableName>[a-zA-Z0-9_$]+)(\\])?(\\`)?"
@"^([\\s]+)?(\\[|\\`)?(?<FieldName>[a-zA-Z0-9_$]+)(\\]|\\`)?"
"TableName"
@"C:\\inetpub\\wwwroot\\flokapture\\ExtractedProjects\\LocationServicesSource\\Pods.Integration.Services.Location.Model\\LocationServiceModel.edmx"
@"^<EntityContainer\\s+Name=\\""([^\\""]*)\\"""
@"^<EntityType\\s+Name=\\""([^\\""]*)\\"""
@"StoreEntitySet=\\""([^\\""]*)\\"""
@"^<Property\\s+"
@"^<EntityType\\s+Name=\\""([^\\""]*)\\""|^<Property\\s+|^</EntityType>\\s+"
"<edmx:Mappings>"
"</EntityType>"
"Done"
"SELECT * FROM EntityAttributes WHERE ProjectId = "
" Group by EntityName;"
@"(?<VariableName>[a-z_]+)\\s*=\\s*new\\s+[a-z.0-9]+?"
"\\\\(\\\\)|[\\\\s]*[\\\\w]+\\\\s+(?<VariableName>[a-zA-Z0-9$_]+)[\\\\s]*=[\\\\s]*"
"." ';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php