Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
I understand that compiling regexes may not be possible on all platforms, but including the Compiled flag on all platforms would improve portability. Compiled can be equivalent to None on unsupported platforms.
Our class libraries target the same subset as Silverlight. Even if we add Compiled, it still will not exist for Silverlight or WinPhone7, so I'm afraid portability is never going to be accomplished.
Your best bet is probably to store the correct enum value as an int based on whether you are on the desktop or mobile, and pass that to your Regex.
int options = 0;
Regex r = new Regex ("", (RegexOptions)options);
The docs describe Compiled as being "Present only in Silverlight for Windows Phone, but not supported."
The reason we filed this bug was that our code works on WP7, but does not work on MonoDroid. Silverlight and Silverlight for Windows Phone are similar, but not the same.
Having the enum value present in MonoDroid would be welcome, especially since AFAIK Reflection Emit works on MonoDroid (JIT), but not on MonoTouch (AOT). On MonoTouch, the Compiled option could just be ignored by the runtime.
Please reconsider this.
Sorry, I only double checked the Silverlight profile. I didn't realize it was in the WinPhone7 profile.
Mono does not have compiled RegularExpressions enabled so it will be like WinPhone7 and won't actually provide any benefit, other than allowing your app to compile.
But I agree that we should match the WinPhone7 API.
it looks like adding the RegexOptions.Compiled value while ignoring it wouldn't be too difficult.
The question thus becomes, should we do this (add RegexOptions.Compiled but ignore it), and should we do the same to MonoTouch?
We should just support the public API (with no aborts), but on MonoTouch this should just be ignored, since we can not JIT.
Committed to mono/master: 298a6c4ef99dea45508aebf177244eadbdc3c4ea
Committed to mono/mono-2-10: a95adaf53dec56a7e0ea63506fc948e7040f411b