Fix PatternSyntaxException on Android 5 & 6#343
Fix PatternSyntaxException on Android 5 & 6#343vonox7 wants to merge 3 commits intobbottema:developfrom
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".