The needed functionality is not present on Java Standard. You will have to use jakarta regexp, and specifically, the StreamCharacterIterator class. This class encapsulates a InputStream for use in regexp operations.
If you want to use the standard regular expression package, I would suggest take a the source from the previous class here and change the contract by implementing CharSequence instead of CharacterIterator.