Add support for named group predicates (as in (?(open)...))
This is necessary to support balanced group regular expressions. The new 'numberOfCaptures' regular expression now will not count such predicate as a capture group.
This commit is contained in:
Родитель
b851a1b963
Коммит
7d4b7161c2
|
@ -11,7 +11,7 @@ namespace ColorCode.Compilation
|
|||
{
|
||||
public class LanguageCompiler : ILanguageCompiler
|
||||
{
|
||||
private static readonly Regex numberOfCapturesRegex = new Regex(@"(?x)(?<!\\)\((?!\?)", RegexOptions.Compiled);
|
||||
private static readonly Regex numberOfCapturesRegex = new Regex(@"(?x)(?<!(\\|(?!\\)\(\?))\((?!\?)", RegexOptions.Compiled);
|
||||
private readonly Dictionary<string, CompiledLanguage> compiledLanguages;
|
||||
private readonly ReaderWriterLockSlim compileLock;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче