
Untitled
By: a guest on
Jun 17th, 2012 | syntax:
None | size: 0.71 KB | hits: 20 | expires: Never
Regex [\S but not [[\S?
Aka: This is ok: [s
This should be skipped: [[s
foreach (Rule rule in rules)
{
if (position + rule.Length > text.Length)
break;
if ((rule.PreCondition & condition) == rule.PreCondition)
{
if (substring.Length < rule.Length)
substring = text.Substring(position, rule.Length);
if (rule.Pattern.IsMatch(substring))
{
string previous = text.Substring(0, position);
sb.Append(previous);
text = text.Remove(0, position);
position = 0;
text = rule.Handler(new HandlerParameter(text, condition, previous));
}
}
}
@"(?<![)[[^[s]"
@"(^|[^[])[[^[s]"
@"[[^s[]"