Skip to content

Commit

Permalink
Fixed Regex
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherie authored and Oren Novotny committed Mar 13, 2019
1 parent 3e5203e commit 4da1ac9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Humanizer.Tests.Shared/ArticlePrefixSortTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Humanizer.Tests
public class ArticlePrefixSortTests
{
[Theory]
[InlineData(new string[] { "an ant", "The Theater", "The apple", "Fox", "Bear" }, new string[] { "an ant", "The apple", "Bear", "Fox", "The Theater" })]
[InlineData(new string[] { "Ant", "The Theater", "The apple", "Fox", "Bear" }, new string[] { "Ant", "The apple", "Bear", "Fox", "The Theater" })]
public void SortStringArrayIgnoringArticlePrefixes(string[] input, string[] expectedOutput)
{
Assert.Equal(expectedOutput, EnglishArticle.PrependArticleSuffix(EnglishArticle.AppendArticlePrefix(input)));
Expand Down
2 changes: 1 addition & 1 deletion src/Humanizer/ArticlePrefixSort.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static string[] AppendArticlePrefix(string[] items)
if (items.Length == 0)
throw new ArgumentOutOfRangeException(nameof(items));

Regex regex = new Regex("^((The)|(the)|(a)|(A)|(An)|(an))");
Regex regex = new Regex("^((The)|(the)|(a)|(A)|(An)|(an))\\s\\w+");
string[] transformed = new string[items.Length];
string article, removed, appended;

Expand Down

0 comments on commit 4da1ac9

Please sign in to comment.