Suppose I need to write a method to look for non-repetetive characters (hyphens and whitespace characters are allowed to be met more than one time in an input):
<code>public static bool IsIsogram(string word)
=> (word == "")
? true
: Regex.Match(word.ToLower(), @"^(?:([a-z])(?!=1)(?:-|s)?)*$").Success;
</code>
<code>public static bool IsIsogram(string word)
=> (word == "")
? true
: Regex.Match(word.ToLower(), @"^(?:([a-z])(?!=1)(?:-|s)?)*$").Success;
</code>
public static bool IsIsogram(string word)
=> (word == "")
? true
: Regex.Match(word.ToLower(), @"^(?:([a-z])(?!=1)(?:-|s)?)*$").Success;
From my point of view, my pattern looks at alphabet characters and, taking lookahead negative assertion, checks if there are any characters further in the string (bakreference)?
What should I change to make it work?