If I have a regular expression, how do I return the substring that it has found?
I’m sure I must be missing something obvious, but I’ve found various methods to confirm that that substring is contained in the string I’m searching, or to replace it with something else, but not to return what I’ve found.
If I have a regular expression, how do I return the substring that it
Share
CharSequenceis an interfaceSee Capturing groups
See group with parameter example
See Java Regex Tutorial