Fix match construction on JVM.

Gets 10-regex.t to pass.