The following single line of code works on iOS but crashes on Android:
Regex rg = new Regex("<img.*?src\\s*=\\s*[\"']data:image/([^;]+);base64,([^\"']*)[\"'].*?/>");
The crash on Android is:
Object reference not set to an instance of an object
at System.Text.RegularExpressions.PatternCompiler.BeginLink (System.Text.RegularExpressions.LinkRef lref) [0x00000] in <filename unknown>:0
at System.Text.RegularExpressions.PatternCompiler.EmitBalanceStart (Int32 gid, Int32 balance, Boolean capture, System.Text.RegularExpressions.LinkRef tail) [0x00000] in <filename unknown>:0
at System.Text.RegularExpressions.Syntax.CharacterClass.Compile (ICompiler cmp, Boolean reverse) [0x00000] in <filename unknown>:0
at System.Text.RegularExpressions.Syntax.Group.Compile (ICompiler cmp, Boolean reverse) [0x00000] in <filename unknown>:0
at System.Text.RegularExpressions.Syntax.Group.Compile (ICompiler cmp, Boolean reverse) [0x00000] in <filename unknown>:0
at System.Text.RegularExpressions.Syntax.RegularExpression.Compile (ICompiler cmp, Boolean reverse) [0x00000] in <filename unknown>:0
at System.Text.RegularExpressions.Regex.CreateMachineFactory (System.String pattern, RegexOptions options) [0x00000] in <filename unknown>:0
at System.Text.RegularExpressions.Regex.InitNewRegex () [0x00000] in <filename unknown>:0
at System.Text.RegularExpressions.Regex.Init () [0x00000] in <filename unknown>:0
at System.Text.RegularExpressions.Regex..ctor (System.String pattern, RegexOptions options) [0x00000] in <filename unknown>:0
at System.Text.RegularExpressions.Regex..ctor (System.String pattern) [0x00000] in <filename unknown>:0
at RigInfoMobile.Services.EditorialArticle.ComputeBase64ImageCache () [0x0002a] in /TFS/MvvmCross/Applications/ActivityTracker/RigInfoMobile.Common/Services/EditorialArticle.cs:46
My version info is:
=== Xamarin Studio ===
Version 4.2.2 (build 2)
Installation UUID: 88c39191-efa4-491f-a4c5-ebd6337dcfd6
Runtime:
Mono 3.2.5 ((no/964e8f0)
GTK+ 2.24.20 theme: Raleigh
GTK# (2.12.0.0)
Package version: 302050000
=== Apple Developer Tools ===
Xcode 5.0.2 (3335.32)
Build 5A3005
=== Xamarin.Android ===
Version: 4.10.1 (Enterprise Edition)
Android SDK: /Users/scastrianni/Library/Developer/Xamarin/android-sdk-mac_x86
Supported Android versions:
4.2 (API level 17)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
=== Xamarin.Mac ===
Xamarin.Mac: Not Installed
=== Xamarin.iOS ===
Version: 7.0.5.2 (Enterprise Edition)
Hash: 9c42159
Branch:
Build date: 2013-02-12 20:04:08-0500
=== Build Information ===
Release ID: 402020002
Git revision: c5f82958ae7d9af652b44b87ceff777b3ad19b91
Build date: 2013-11-19 15:35:40+0000
Xamarin addins: a4044fee09138f6fd031a9944b7caaeb51e57e80
=== Operating System ===
Mac OS X 10.8.5
Darwin Shawns-MacBook-Pro.local 12.5.0 Darwin Kernel Version 12.5.0
Sun Sep 29 13:33:47 PDT 2013
root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64