Created
November 17, 2020 21:12
-
-
Save mrlacey/6b35af1d187742c445ded263d07e09dc to your computer and use it in GitHub Desktop.
FestiveEditor - 8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal sealed class FestiveImageTagger : RegexTagger<FestiveImageTag> | |
{ | |
internal FestiveImageTagger(ITextBuffer buffer) | |
: base( | |
buffer, | |
new[] { new Regex(@"\W(\w{3,7})\W", RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.IgnoreCase) }) | |
{ | |
} | |
protected override FestiveImageTag TryCreateTagForMatch(Match match) | |
{ | |
if (match.Groups.Count == 2) | |
{ | |
var term = match.Groups[1].Value; | |
return new FestiveImageTag(term); | |
} | |
return null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment