using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"^(?=.*px\;)([ \S]*)";
string substitution = @"$1";
string input = @".inpt-line {
position: relative;
display: block;
min-height: 56px;
width: 660px;
box-sizing: border-box;
padding: 20px 20px 5px 20px;
color: #787373;
}
.inpt-line label {
font-size: 22px;
font-weight: bold;
text-align: right;
width: 250px;
height: 50px;
}
.inpt-line input,
.inpt-line select {
position: relative;
top: -3px;
height: 30px;
width: 235px;
font-size: 18px;
padding-left: 10px;
box-sizing: border-box;
margin: 0px 15px 5px 10px;
}
input[type=""number""] {
width: 80px
}
";
RegexOptions options = RegexOptions.Multiline | RegexOptions.IgnoreCase;
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