public static IP5Regex CompileRegex(Runtime runtime, P5Scalar value, int flags) { if (value.IsReference(runtime)) { var rx = value.DereferenceRegex(runtime); if (rx != null) return rx; } if (runtime.NativeRegex) return new NetRegex(value.AsString(runtime)); else throw new System.Exception("P5: Needs compiler to recompile string expression"); }