title: Are regex treated differently between regular java app and android app?
body: <p>I just tried using picocli in one of my android projects (android 9). See <a href="https://picocli.info/" rel="nofollow noreferrer">here</a> for more information about picocli.
  I tried picocli before in a local project (just with a main method, not using android) and it worked well.</p>
  
  <p>But then I adapted the code to get it works in android app, and a got an exception inside picocli when processing some regex, and I made some tests to figure out what was going on. When I try to run this code :</p>
  
  <pre><code>String test = "test";
  test.replaceAll("\\$\\{COMMAND-NAME}", "string replacement");
  </code></pre>
  
  <ul>
  <li>If it is a classic java app : no problem.</li>
  <li>If it is inside android app : This exception occurs :</li>
  </ul>
  
  <pre><code>2020-02-06 10:31:46.409 3971-3971/? W/System.err: java.util.regex.PatternSyntaxException: Syntax error in regexp pattern near index 17
  2020-02-06 10:31:46.409 3971-3971/? W/System.err: \$\{COMMAND-NAME}
  2020-02-06 10:31:46.409 3971-3971/? W/System.err:                  ^
  2020-02-06 10:31:46.410 3971-3971/? W/System.err:     at java.util.regex.Pattern.compileImpl(Native Method)
  2020-02-06 10:31:46.410 3971-3971/? W/System.err:     at java.util.regex.Pattern.compile(Pattern.java:1344)
  2020-02-06 10:31:46.411 3971-3971/? W/System.err:     at java.util.regex.Pattern.&lt;init&gt;(Pattern.java:1328)
  2020-02-06 10:31:46.411 3971-3971/? W/System.err:     at java.util.regex.Pattern.compile(Pattern.java:950)
  2020-02-06 10:31:46.411 3971-3971/? W/System.err:     at java.lang.String.replaceAll(String.java:2286)
  2020-02-06 10:31:46.411 3971-3971/? W/System.err:     at com.irdeto.androidadmintool.MainActivity.onCreate(MainActivity.java:39)
  2020-02-06 10:31:46.411 3971-3971/? W/System.err:     at android.app.Activity.performCreate(Activity.java:7136)
  2020-02-06 10:31:46.411 3971-3971/? W/System.err:     at android.app.Activity.performCreate(Activity.java:7127)
  2020-02-06 10:31:46.411 3971-3971/? W/System.err:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
  2020-02-06 10:31:46.411 3971-3971/? W/System.err:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
  2020-02-06 10:31:46.412 3971-3971/? W/System.err:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
  2020-02-06 10:31:46.412 3971-3971/? W/System.err:     at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
  2020-02-06 10:31:46.412 3971-3971/? W/System.err:     at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
  2020-02-06 10:31:46.412 3971-3971/? W/System.err:     at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
  2020-02-06 10:31:46.412 3971-3971/? W/System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
  2020-02-06 10:31:46.412 3971-3971/? W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:106)
  2020-02-06 10:31:46.413 3971-3971/? W/System.err:     at android.os.Looper.loop(Looper.java:193)
  2020-02-06 10:31:46.413 3971-3971/? W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:6669)
  2020-02-06 10:31:46.413 3971-3971/? W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
  2020-02-06 10:31:46.413 3971-3971/? W/System.err:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
  2020-02-06 10:31:46.413 3971-3971/? W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
  </code></pre>
  
  <p>What's wrong here ? Am i missing something ?</p>