X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fcarfire;a=blobdiff_plain;f=CarFire%2FCarFire%2FCarFire%2FParse.cs;h=b9320778babcbcdfb62d685aec9306ce2639d6c7;hp=169cf30a7b8340b59af9aa61aae521c9e7c04ad8;hb=1393586d1e5639ac8f1e9fc8183644050dd54165;hpb=2eb9216eac3321adc2f897068396e7fb1f126089
diff --git a/CarFire/CarFire/CarFire/Parse.cs b/CarFire/CarFire/CarFire/Parse.cs
index 169cf30..b932077 100644
--- a/CarFire/CarFire/CarFire/Parse.cs
+++ b/CarFire/CarFire/CarFire/Parse.cs
@@ -25,6 +25,18 @@ namespace CarFire
return null;
}
+ ///
+ /// Parses a comment of an INI file.
+ ///
+ /// Text.
+ /// The comment.
+ public static string IniComment(string line)
+ {
+ Match match = Regex.Match(line, @"^;\s*(.*)\s*$");
+ if (match.Success) return match.Groups[1].Value;
+ return null;
+ }
+
///
/// Parses a key-value pair.
///
@@ -182,7 +194,6 @@ namespace CarFire
// FIXME: This may barf all over itself if there are nested parentheses, doublequotes, brackets, etc.
foreach (Match match in matches)
{
- Console.WriteLine("matched: " + match.Value);
list.Add(match.Value);
}