Content deleted Content added
→About Java Regex Variable-length lookaround: new section |
m Signing comment by Bczhc - "→About Java Regex Variable-length lookaround: new section" |
||
Line 119:
I just tested regex "(?<=[a-z]+)[0-9]+" on some Java platforms, including Oracle JDK and OpenJDK 1.8, Oracle JDK and OpenJDK 17 at the text "abcd12345", and it gave the correct result "12345"; the variable-width look-ahead regex "[0-9]+(?=[a-z]+)" also works fine on Java on my machine. But on Android platform with API level 29 and Java source/target compatibility version 1.8, this regular expression has a compilation error for the reason of "non-fixed width look-behind". Also on the website [https://regex101.com/r/kB8Y47/1 regex test] it fails with Java 8 flavor.
I don't know how these work on Java, and the different results above, very confused now. <!-- Template:Unsigned --><span class="autosigned" style="font-size:85%;">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:Bczhc|Bczhc]] ([[User talk:Bczhc#top|talk]] • [[Special:Contributions/Bczhc|contribs]]) 02:52, 5 February 2022 (UTC)</span> <!--Autosigned by SineBot-->
|