.NET Fiddle

CSharp · Console

/Program.cs

using System;
using System.Text.RegularExpressions;

var pattern = @"(?((?'-1'))|((?'1'\S)|))+(?!(?'-1'))";
//pattern = @"(?((?'-1'))|((?'1'\S)|(?'1'\s)))+(?!(?'-1'))";
var input = "abc";

var timeout = TimeSpan.FromMilliseconds(10);
var regexCompiled = new Regex(pattern, RegexOptions.Compiled, timeout);
var regexInterpreted = new Regex(pattern, RegexOptions.None, timeout);

try
{
	Console.WriteLine($"----------Interpreted results count:{regexInterpreted.Matches(input).Count}------------");
	foreach(Match mh in regexInterpreted.Matches(input))
	{
		Console.WriteLine($"Interpreted: [{mh.Value}]");
	}
	Console.WriteLine($"----------Compiled results count:{regexCompiled.Matches(input).Count}------------");
	foreach(Match mh in regexCompiled.Matches(input))
	{
		Console.WriteLine($"Compiled: [{mh.Value}]");
	}
}
catch(Exception ex)
{
	Console.WriteLine(ex.Message);
}
;