-
-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix PatternSyntaxException on Android 5 & 6 #343
Conversation
Exception message: `Syntax error in regexp pattern near index 38: ^simplejavamail\.extraproperties\.(?<actualProperty>.*)` Please note that Android 5 doesn't support named capturing groups, see https://github.com/tony19/named-regexp or https://stackoverflow.com/questions/32776168/regex-pattern-in-android-studio-throws-error-this-named-group-syntax-is-not-su. Changing this to an unnamed capture group creates no functional change, except that there are no RuntimeCrashes when using simple-java-mail with old Android versions.
I used named groups in a few more places, are those not problematic? |
Ok yeah, this could then be problematic too. Probably depends on the usage of simple-java-mail. |
For everyone else who is also struggling with crashes on Android due to newer simple-java-mail versions: https://github.com/bbottema/simple-java-mail/releases/tag/6.1.0 is the last version that doesn't use named capturing groups, so use this version in case you use simple-java-mail on Android. |
This PR removes now all named regex groups except the one used in @bbottema sadly i was not able to compile the project locally, so please run the tests on your machine when merging this PR. |
Closing in favor of solution 2 in #352 (integrate named-regexp instead, which adds named regex group support Android) |
Exception message:
Syntax error in regexp pattern near index 38: ^simplejavamail\.extraproperties\.(?<actualProperty>.*)
Please note that Android 5 doesn't support named capturing groups, see https://github.com/tony19/named-regexp or https://stackoverflow.com/questions/32776168/regex-pattern-in-android-studio-throws-error-this-named-group-syntax-is-not-su.
Changing this Regex to an unnamed capture group creates no functional change, except that there are no RuntimeCrashes when using simple-java-mail with old Android versions.
Note: group 0 is "whole regex", group 1 is "first group".