using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(\r?\n)\s*(?=\r?\n)(?=[^\s]+?|$)";
string substitution = @"$1";
string input = @"var массив = [
function(){
var слой = document.createElement(""div"")
слой.id = ""ID""
document.body.appendChild(слой)
слой.style.width = ""200px""
слой.style.height = ""200px""
слой.style.position = ""absolute""
слой.style.left = ""0%""
слой.style.top = ""0%""
слой.style.filter = ""drop-shadow(1px 1px 5px Yellow)""
слой.style.boxShadow = ""1px 1px 5px IndianRed""
return 1000},
function(){
элемент = ID
элемент.style.transition = ""all 1s cubic-bezier(0.5,-0.5,0.5,1.5) ""
элемент.style.position = ""absolute""
элемент.style.left = ""33%""
элемент.style.top = ""33%""
return 1000},
]";
RegexOptions options = RegexOptions.Multiline;
Regex regex = new Regex(pattern, options);
string result = regex.Replace(input, substitution);
}
}
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 C#, please visit: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx