Permalink
Browse files

merged

  • Loading branch information...
2 parents bd13d07 + e6af558 commit c0745083fb3983f64b9adf5fae5cbe30bfca332a @Buildstarted Buildstarted committed Dec 3, 2011
Showing with 12 additions and 2 deletions.
  1. +11 −1 JabbR.Test/TextTransformFacts.cs
  2. +1 −1 JabbR/Infrastructure/TextTransform.cs
@@ -37,7 +37,17 @@ public void HashtagRegexMatchesHashtagString()
}
[Fact]
- public void HashtagRegexMatchesHashtagInSubstring()
+ public void HashtagRegexMatchesHashtagWithDashString()
+ {
+ Regex hashtagRegex = HashtagRegex();
+
+ var result = hashtagRegex.IsMatch("#dash-tag");
+
+ Assert.True(result);
+ }
+
+ [Fact]
+ public void HashtagRegexMatchesHashtagInSubstring()
{
Regex hashtagRegex = HashtagRegex();
@@ -11,7 +11,7 @@ namespace JabbR.Infrastructure {
public class TextTransform
{
private readonly IJabbrRepository _repository;
- public const string HashTagPattern = @"(?:(?<=\s)|^)#(\w*[A-Za-z_]+\w*)";
+ public const string HashTagPattern = @"(?:(?<=\s)|^)#([A-Za-z0-9-_.]{1,30}\w*)";
public TextTransform(IJabbrRepository repository)
{

0 comments on commit c074508

Please sign in to comment.