Repository navigation
A few typos in the Regular Expression tutorial ( https://dev.java/learn/regex ) #212
Description
Activity
Thank you again Willy for your report! I just pushed a fix.
Thanks!
The items reported above are confirmed as resolved in
https://web.archive.org/web/20260318144533/https://dev.java/learn/regex/character-classes/
https://web.archive.org/web/20260318144825/https://dev.java/learn/regex/groups/
https://web.archive.org/web/20260318150059/https://dev.java/learn/regex/pattern-syntax-exception/ .- moved this from Backlog to Done in @Drovie's untitled project
on Mar 18, 2026 Thanks again for all this content.
I am re-opening this temporarily to report another item I noticed from the dev.java team in these tutorials.
In the latest version of https://dev.java/learn/regex/patterns/ (archived as is at https://web.archive.org/web/20260710213855/https://dev.java/learn/regex/patterns/ ),
-
In the sentence
public String[] split(String regex, int limit): Splits this string around matches of the given regular expression. An invocation of this method of the form str.split(regex, n) yields the same result as the expression Pattern.compile(regex).split(str, n)
"public String[] split(String regex, int limit)" links to the wrong method, "matches" ( https://docs.oracle.com/en/java/javase/26/docs/api/java.base/java/lang/String.html#matches(java.lang.String,int) )
instead of "split" ( https://docs.oracle.com/en/java/javase/26/docs/api/java.base/java/lang/String.html#split(java.lang.String,int) ).
No AI or LLM was used in finding these or any other items reported by me on dev.java but I did use a Java program to help me pull many (in some cases all) of the javadoc links from some of these tutorials and present the link URL vs the link text to speed up broken/mismatched link reviews (one of the more common categories of errors) and running that tool back over this tutorial surfaced this item I did not catch earlier.
Thanks!
-
Thank you again for your report! A fix is on its way.
Thanks!
In the latest version of https://dev.java/learn/regex/patterns/ (archived as is at https://web.archive.org/web/20260712054724/https://dev.java/learn/regex/patterns/ )
-
In the sentence
An invocation of this method of the form str.matches(regex) yields exactly the same result as the expression Pattern.matches(regex, str).
"Pattern.matches(regex, str)" links to https://docs.oracle.com/en/java/javase/26/docs/api/java.base/java/util/regex/Pattern.html#matches(java.lang.CharSequence,int)
which refers to a method that does not exist "matches(java.lang.CharSequence,int)", it should link to https://docs.oracle.com/en/java/javase/26/docs/api/java.base/java/util/regex/Pattern.html#matches(java.lang.String,java.lang.CharSequence) .
-
Thanks again for your report! A fix is on its way.
Thanks!
Hello dev.java team,
Thanks again for these articles. Reporting some minor typos I noticed in the Regular Expression tutorial ( https://dev.java/learn/regex ) while reading it.
In https://dev.java/learn/regex/character-classes/ (archived as is at https://web.archive.org/web/20260314154513/https://dev.java/learn/regex/character-classes/ )
both of these character class examples are missing closing square brackets.
In https://dev.java/learn/regex/groups/ (archived as is at https://web.archive.org/web/20260317233826/https://dev.java/learn/regex/groups/ ):
has an extra closing ")" .
In https://dev.java/learn/regex/pattern-syntax-exception/ (archived as is at https://web.archive.org/web/20260314231612/https://dev.java/learn/regex/pattern-syntax-exception/ ):
Thanks so much! Feel free to leave open even if you address the above as I would also be happy to confirm any changes before closing if desired.