I have these examples:
{I18n.get("Testing 123...")}
{I18n.get('Testing 123...')}
{I18n.get(
"Testing 123..."
)}
{I18n.get("Testing 123..."
)}
{I18n.get(
"Testing 123...")}
I want to extract the 'Testing 123...' in .Net using C# Regex. What I did was:
Regex r = new Regex(@"(?:I18n.get\(""(.+?)""\))", RegexOptions.IgnoreCase | RegexOptions.Singleline);
var matches = r.Matches(txt)
.Select(xx=> xx.Groups)
.Select(xx=> xx.Last().Value)
.ToList();
When is single line works perfect, but when is multiple line it fails...
And how would be possible to match in a single Regex when the txt is with double quotes " or when is with single quotes ' ?