title: Checking if string contains only allowed characters
body: <p>I want to check if my string contains only allowed character. Matcher works properly, but when I input something like this "123A" app crashes. For only letters it work properly(error). How can I do that?    </p>
  
  <p>My code:</p>
  
  <pre><code>pattern = Pattern.compile("[0-9]");
  matcher = pattern.matcher(stNumber);
    if(matcher.find())
  else
     error
  </code></pre>
  
  <p>This is my logcat error:</p>
  
  <pre><code>03-07 21:49:50.917    1891-1891/com.converter_numeralsystem.app E/AndroidRuntime﹕ FATAL EXCEPTION: main
  Process: com.converter_numeralsystem.app, PID: 1891
  java.lang.NumberFormatException: Invalid long: "112a"
          at java.lang.Long.invalidLong(Long.java:124)
          at java.lang.Long.parse(Long.java:361)
          at java.lang.Long.parseLong(Long.java:352)
          at java.lang.Long.parseLong(Long.java:318)
          at com.converter_numeralsystem.app.MainActivity.calculate(MainActivity.java:121)
          at com.converter_numeralsystem.app.MainActivity.onClick(MainActivity.java:246)
          at android.view.View.performClick(View.java:4438)
          at android.view.View$PerformClick.run(View.java:18422)
          at android.os.Handler.handleCallback(Handler.java:733)
          at android.os.Handler.dispatchMessage(Handler.java:95)
          at android.os.Looper.loop(Looper.java:136)
          at android.app.ActivityThread.main(ActivityThread.java:5017)
          at java.lang.reflect.Method.invokeNative(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:515)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
          at dalvik.system.NativeStart.main(Native Method)
  </code></pre>