Get Programming Language Keywords By Using Regular Expression in Java

We can use regular expression to get all Java keywords in a program. The key is using word boundary correctly. For example, given “static staticField”, the first word should be recognized as a keyword but the second should not.

Read more