Skip to content

Instantly share code, notes, and snippets.

@RlonRyan
Created September 24, 2016 20:05
Show Gist options
  • Save RlonRyan/0bc5bdfcf8d1a304167c4c60523bf617 to your computer and use it in GitHub Desktop.
Save RlonRyan/0bc5bdfcf8d1a304167c4c60523bf617 to your computer and use it in GitHub Desktop.
Regex describing valid java identifiers.
(?!(?:abstract|continue|for|new|switch|assert|default|if|package|synchronized|boolean|do|goto|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)(?=\Z|\s|;))(?<=\A|\s|;)[\p{L}\p{Pc}$^\s][\p{L}\p{Pc}$\p{N}]*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment