title: Android: PatternSyntaxException: Syntax error U_ILLEGAL_ARGUMENT_ERROR
body: <p>I'm using <a href="https://code.google.com/p/json-io/" rel="nofollow">json-io</a> for converting some JSON data to Java objects:</p>
  
  <pre><code>DataTransferContainer dataTransferContainer = (DataTransferContainer)JsonReader.jsonToJava(json);
  </code></pre>
  
  <p>DataTransferContainer is just an object containing some GeoJson elements. It does not matter for this issue.</p>
  
  <p>The above code works in JUnit test outside Android, but when I run this on Android, I get this RuntimeException:</p>
  
  <pre><code>12-07 20:12:51.260: E/AndroidRuntime(2002): FATAL EXCEPTION: AsyncTask #1
  12-07 20:12:51.260: E/AndroidRuntime(2002): java.lang.RuntimeException: An error occured while executing doInBackground()
  12-07 20:12:51.260: E/AndroidRuntime(2002):     at android.os.AsyncTask$3.done(AsyncTask.java:200)
  12-07 20:12:51.260: E/AndroidRuntime(2002):     at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274)
  12-07 20:12:51.260: E/AndroidRuntime(2002):     at java.util.concurrent.FutureTask.setException(FutureTask.java:125)
  12-07 20:12:51.260: E/AndroidRuntime(2002):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308)
  12-07 20:12:51.260: E/AndroidRuntime(2002):     at java.util.concurrent.FutureTask.run(FutureTask.java:138)
  12-07 20:12:51.260: E/AndroidRuntime(2002):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
  12-07 20:12:51.260: E/AndroidRuntime(2002):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
  12-07 20:12:51.260: E/AndroidRuntime(2002):     at java.lang.Thread.run(Thread.java:1019)
  12-07 20:12:51.260: E/AndroidRuntime(2002): Caused by: java.lang.ExceptionInInitializerError
  12-07 20:12:51.260: E/AndroidRuntime(2002):     at com.mydomain.myapp.dataprocessing.JsonConverter.jsonObjectToObject(JsonConverter.java:22)
  12-07 20:12:51.260: E/AndroidRuntime(2002):     at com.mydomain.myapp.dataprocessing.DataManagerTask.processDataFromRemote(DataManagerTask.java:104)
  12-07 20:12:51.260: E/AndroidRuntime(2002):     at com.mydomain.myapp.dataprocessing.DataManagerTask.doInBackground(DataManagerTask.java:56)
  12-07 20:12:51.260: E/AndroidRuntime(2002):     at com.mydomain.myapp.dataprocessing.DataManagerTask.doInBackground(DataManagerTask.java:18)
  12-07 20:12:51.260: E/AndroidRuntime(2002):     at android.os.AsyncTask$2.call(AsyncTask.java:185)
  12-07 20:12:51.260: E/AndroidRuntime(2002):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
  12-07 20:12:51.260: E/AndroidRuntime(2002):     ... 4 more
  12-07 20:12:51.260: E/AndroidRuntime(2002): Caused by: java.util.regex.PatternSyntaxException: Syntax error U_ILLEGAL_ARGUMENT_ERROR
  12-07 20:12:51.260: E/AndroidRuntime(2002): (\d{2})[:.](\d{2})[:.](\d{2})[.](\d{1,10})([+-]\d{2}[:]?\d{2}|Z)?
  12-07 20:12:51.260: E/AndroidRuntime(2002):     at java.util.regex.Pattern.compileImpl(Native Method)
  12-07 20:12:51.260: E/AndroidRuntime(2002):     at java.util.regex.Pattern.compile(Pattern.java:400)
  12-07 20:12:51.260: E/AndroidRuntime(2002):     at java.util.regex.Pattern.&lt;init&gt;(Pattern.java:383)
  12-07 20:12:51.260: E/AndroidRuntime(2002):     at java.util.regex.Pattern.compile(Pattern.java:374)
  12-07 20:12:51.260: E/AndroidRuntime(2002):     at com.cedarsoftware.util.io.JsonReader.&lt;clinit&gt;(JsonReader.java:114)
  12-07 20:12:51.260: E/AndroidRuntime(2002):     ... 10 more
  </code></pre>
  
  <p>In JsonReader, line 114 looks like this:</p>
  
  <blockquote>
  <pre><code>private static final Pattern timePattern1 = Pattern.compile("(\\d{2})[:.](\\d{2})[:.](\\d{2})[.](\\d{1,10})([+-]\\d{2}[:]?\\d{2}|Z)?");
  </code></pre>
  </blockquote>
  
  <p>I was able to narrow it down. It's this part: <strong>[:.]</strong>  </p>
  
  <p>It just means "any character" or "colon". What's wrong with that on Android?</p>