Skip to content

Commit

Permalink
Issue naraga#15 - Fixed regular expression
Browse files Browse the repository at this point in the history
  • Loading branch information
KlesakoW committed Feb 28, 2014
1 parent 8024fc3 commit 21e0190
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ConfigizerLib/ConfigurationLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ public static ConfigurationFileInfo Load(string path)

public static string RemoveTags(string contents, params string[] tags)
{
return Regex.Replace(contents, @"(^#(" + string.Join("|", tags) + @")\s+(?<val>.*)\s+$)", "",
return Regex.Replace(contents, @"(^#(" + string.Join("|", tags) + @")\s+(?<val>.*)\s*$)", "",
RegexOptions.Multiline | RegexOptions.IgnoreCase);
}

public static string[] GetTagValues(string contents, string tagName)
{
var tags = Regex.Matches(contents, @"(^#" + tagName + @"\s+(?<val>.*)\s+$)",
var tags = Regex.Matches(contents, @"(^#" + tagName + @"\s+(?<val>.*)\s*$)",
RegexOptions.Multiline | RegexOptions.IgnoreCase);
return tags.OfType<Match>().Select(m => m.Groups["val"].Value.Trim()).ToArray();
}
Expand Down

0 comments on commit 21e0190

Please sign in to comment.