Skip to content

A few typos in the Regular Expression tutorial ( https://dev.java/learn/regex ) #212

Description

@willy-b

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/ )

[a-z&&[def] 	d, e, or f (intersection)
[a-z&&[^bc] 	a through z, except for b and c: [ad-z] (subtraction)

both of these character class examples are missing closing square brackets.

Image

In https://dev.java/learn/regex/groups/ (archived as is at https://web.archive.org/web/20260317233826/https://dev.java/learn/regex/groups/ ):

public int start(int group)): Returns the start index of the subsequence captured by the given group during the previous match operation.

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/ ):

  • The sentence "The following source code our test harness to check for malformed regular expressions:" appears to be missing a word, should possibly start with "The following source code UPDATES our test harness" (missing word, "updates" or similar).

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.

Activity

  1. JosePaumard commented on Mar 18, 2026

    @JosePaumard
    Contributor

    Thank you again Willy for your report! I just pushed a fix.

  2. willy-b commented on Jul 11, 2026

    @willy-b
    Author

    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/ ),


    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!

  3. JosePaumard commented on Jul 11, 2026

    @JosePaumard
    Contributor

    Thank you again for your report! A fix is on its way.

  4. willy-b commented on Jul 12, 2026

    @willy-b
    Author

    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/ )

  5. JosePaumard commented on Jul 12, 2026

    @JosePaumard
    Contributor

    Thanks again for your report! A fix is on its way.

  6. willy-b commented on Jul 14, 2026

    @willy-b
    Author

    Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions